import java.util.*;
import java.io.*;

public class circles_sp implements Runnable {
    public static void main(String[] args) {
        new Thread(new circles_sp()).start();
    }

    @Override
    public void run() {
        try {
            br = new BufferedReader(new FileReader("circles.in"));
            out = new PrintWriter("circles.out");
            solve();
            out.close();
        } catch (FileNotFoundException e) {
        }
    }

    BufferedReader br;
    StringTokenizer st;
    PrintWriter out;
    boolean eof = false;

    String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return "0";
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(nextToken());
    }

    double nextDouble() {
        return Double.parseDouble(nextToken());
    }

    long nextLong() {
        return Long.parseLong(nextToken());
    }

    final int MAXN = 100000;
    final int MAX = 1000000000;
    
    double eps = 0;
    double eps2 = 1e-6;
    
    class Circle {
    	double x, y, r;
    	Point p;
    	
    	Circle(double x, double y, double r) {
    		this.x = x;
    		this.y = y;
    		this.r = r;
    		p = new Point(x, y);
    	}
    	
    	boolean contains(double xx, double yy) {
//    		System.err.println(p.dist(xx, yy) - r);
    		return Math.abs(p.dist(xx, yy) - r) < eps2 || Math.abs(p.dist(xx, yy) - r) < eps * Math.abs(p.dist(xx, yy) + r);
    	}
    }
    
    class Line {
    	double a, b, c;
    	
    	Line(long a, long b) {
    		this.a = a;
    		this.b = b;
    	}
    	
//    	Line(int x1, int y1, int x2, int y2) {
//    		a = y2 - y1;
//    		b = x1 - x2;
//    		c = -a * x1 - b * y2;
//    	}
//    	
//    	Line middle(int x1, int y1, int x2, int y2) {
//    		Line l = new Line(-b, a);
//    		long d1 = l.a * x1 + l.b * y1;
//    		long d2 = l.a * x2 + l.b * y2;
//    		l.a *= 2;
//    		l.b *= 2;
//    		l.c = -d1 - d2;
//    		return l;
//    	}
    	
    	Point inter(Line l) {
    		double t = 1.0 * a * l.b - 1.0 * b * l.a;
    		if (t == 0) return null;
    		return new Point((l.c * b - c * l.b + 0.0) / t, (l.a * c - l.c * a + 0.0) / t);
    	}
    }
    
    class Point {
    	double x, y;
    	
    	Point(double x, double y) {
    		this.x = x;
    		this.y = y;
    	}
    	
    	double dist(double xx, double yy) {
    		return Math.sqrt((x - xx) * (x - xx) + (y - yy) * (y - yy)); 
    	}
    }
    
    Line middleLine(long x1, long y1, long x2, long y2) {
    	Line l = new Line((x1 - x2), (y1 - y2));
    	l.c = (-l.a * (x1 + x2) - l.b * (y1 + y2)) / 2.0;
    	return l;
    }
    
    Circle getCircle(int x1, int y1, int x2, int y2, int x3, int y3) {
//    	Line l1 = new Line(x1, y1, x2, y2).middle(x1, y1, x2, y2);
//    	Line l2 = new Line(x1, y1, x3, y3).middle(x1, y1, x3, y3);
    	Line l1 = middleLine(x1, y1, x2, y2);
    	Line l2 = middleLine(x1, y1, x3, y3);
//    	double a = new Point(x1, y1).dist(x2, y2);
//    	double b = new Point(x1, y1).dist(x3, y3);
//    	double c = new Point(x3, y3).dist(x2, y2);
//    	double pp = (a + b + c) / 2;
//    	double r = a * b * c / (4 * Math.sqrt(pp * (pp - a) * (pp - b) * (pp - c)));
    	Point p = l1.inter(l2);
    	if (p == null) {
    		return null;
    	}
    	return new Circle(p.x, p.y, p.dist(x1, y1));
    }

    void solve() {
    	int n = nextInt();
    	int[] x = new int[n];
    	int[] y = new int[n];
    	for (int i = 0; i < n; i++) {
    		x[i] = nextInt();
    		y[i] = nextInt();
    	}
    	if (n == 2) {
    		out.println("1");
    		out.println("2");
    		return;
    	}
    	if (n == 3) {
    		out.println("1");
    		out.println("2 3");
    		return;
    	}
    	if (n == 4) {
    		out.println("1 2");
    		out.println("3 4");
    		return;
    	}
    	for (int i1 = 0; i1 < 3; i1++) {
    		for (int i2 = i1 + 1; i2 < 5; i2++) {
    			for (int i3 = i2 + 1; i3 < 5; i3++) {
    				Circle c = getCircle(x[i1], y[i1], x[i2], y[i2], x[i3], y[i3]);
    				if (c == null) continue;
    				boolean[] u = new boolean[n];
    				for (int i = 0; i < n; i++) {
    					if (c.contains(x[i], y[i])) {
    						u[i] = true;
    					}
    				}
    				int cnt = 0;
    				int[] ind = new int[3];
    				for (int i = 0; i < n; i++) {
    					if (!u[i]) {
    						ind[cnt++] = i;
    						if (cnt == 3) break;
    					}
    				}
    				boolean good = true;
    				boolean[] u2 = new boolean[n];
    				if (cnt == 3) {
    					Circle c2 = getCircle(x[ind[0]], y[ind[0]], x[ind[1]], y[ind[1]], x[ind[2]], y[ind[2]]);
    					if (c2 == null) {
    						good = false;
    					}
    					for (int i = 0; i < n; i++) {
    						if (good && !u[i] && !c2.contains(x[i], y[i])) {
    							good = false;
    						}
    						if (c2 != null && c2.contains(x[i], y[i])) {
    							u2[i] = true;
    						}
    					}
    				}
					if (good) {
						for (int i = 0; i < n; i++) {
							if (u[i]) {
								out.print((i + 1) + " ");
							}
						}
						out.println();
						for (int i = 0; i < n; i++) {
							if (u2[i] || !u[i]) {
								out.print((i + 1) + " ");
							}
						}
						out.println();
						return;
					}
    			}
    		}
    	}
    	throw new AssertionError("Circles not found!");
    }
}
