#include <cmath>
#include <iostream>
#include <vector>
#include <set>
#include <cstdio>
#include <string>
#include <queue>
#include <cmath>
#include <algorithm>

using namespace std;

struct point
{
	double x, y;
	point(): x(0), y(0) {};
	point(double x, double y): x(x), y(y) {};
};

struct circle
{
	point c;
	double r;
	circle(): c(point()), r(0) {};
	circle(point p, double r): c(p), r(r) {};
};

double dist(point a, point b)
{
	return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y)); 
}

struct line
{
	double a, b, c;
	line(): a(0), b(0), c(0) {};
	line(point p, point v): a(-v.y), b(v.x), c(v.y * p.x - v.x * p.y){};
};

double det(double a, double b, double c, double d) {
	return a * d - b * c;
}

point intersect_line(line m, line n)
{
	point res;
	double zn = det(m.a, m.b, n.a, n.b);
	res.x = -det(m.c, m.b, n.c, n.b) / zn;
	res.y = -det(m.a, m.c, n.a, n.c) / zn;
	return res;
}
circle get_circle(point p1, point p2, point p3)
{
	double a = dist(p1, p2);
	double b = dist(p3, p2);
	double c = dist(p1, p3);
	double p = (a + b + c) / 2;
	double r = a * b * c / (4 * sqrt(p * (p - a) * (p - b) * (p - c)));
	line l1, l2;
	l1.a = p1.x - p2.x;
	l1.b = p1.y - p2.y;
	l1.c = -l1.a * (p1.x + p2.x) / 2 - l1.b * (p1.y + p2.y) / 2;

	l2.a = p1.x - p3.x;
	l2.b = p1.y - p3.y;
	l2.c = -l2.a * (p1.x + p3.x) / 2 - l2.b * (p1.y + p3.y) / 2;

	point po = intersect_line(l1, l2);
	return circle(po, r);
}



int main()
{
	freopen("circles.in", "r", stdin);
	freopen("circles.out", "w", stdout);
	int n;
	cin >> n;
	vector<point> points(n);
	for (int i = 0; i < n; i++)
		cin >> points[i].x >> points[i].y;
	if (n < 4)
	{
        cout << "1\n2" << ((n == 3) ? " 3" : "") << "\n";
		return 0;
	}

	if (n == 4)
	{
		cout << "1 2\n3 4\n";
		return 0;
	}

    vector<int> perm(5);
	for (int i = 0; i < 5; i++)
		perm[i] = i;

	for (int i = 0; i < 120; i++)
	{
		circle c1 = get_circle(points[perm[0]], points[perm[1]], points[perm[2]]);
		vector<bool> used(n);
		vector<int> ans1, ans2;
		for (int i = 0; i < n; i++)
		{
			if (fabs(dist(c1.c, points[i]) - c1.r) <= 1e-5)
			{
				ans1.push_back(i);
				used[i] = true;
			}
		}
		int cnt = 0;
		point p[3];
		int uk = 0;
		while (uk < n && cnt < 3)
		{
			if (!used[uk]) p[cnt++] = points[uk];
			uk++;
		}
		if (cnt < 3)
		{
			for (int i = 0; i < n; i++)
				if (!used[i])
				{
					ans2.push_back(i);
					used[i] = true;
				}
			if (cnt == 0) ans2.push_back(0);
		}
		else
		{
			circle c2 = get_circle(p[0], p[1], p[2]);
			for (int i = 0; i < n; i++)
			{
				if (fabs(dist(c2.c, points[i]) - c2.r) <= 1e-5)
				{
					ans2.push_back(i);
					used[i] = true;
				}
			}
		}
		for (int i = 0; i < n; i++)
			if (!used[i])
			{
				next_permutation(perm.begin(), perm.end());
				continue;
			}
        if (ans1.size() == n && ans2.size() == n) ans2.resize(1);
		for (int i = 0; i < ans1.size(); i++)
			cout << ans1[i] + 1 << ((i + 1 == ans1.size()) ? '\n' : ' '); 

		for (int i = 0; i < ans2.size(); i++)
			cout << ans2[i] + 1 << ((i + 1 == ans2.size()) ? '\n' : ' ');
		return 0;
	}
}
