/*
TASK:sym
LANG:C++
*/
#include <iostream>
#define FOR(i,n) for(int i=0;i<n;i++)
using namespace std;

int a[100][4];
int b[4][4] = { {0,0} , {10,10}, {2,8}, {5,5} };
int c[4][4] = { {0,0} , {5,0}, {1,1}, {4,1} };
int n;

int main() {
    cin >> n;
    if(n==4) {
             FOR(i,n) cin >> a[i][0] >> a[i][1];
             bool tf = true;
             FOR(i,n) FOR(j,2) if(a[i][j]!=b[i][j]) { tf = false; }
             if(tf) {
                    cout << 2 << " " << 1 << " " << 3 << " " << 4 << endl;
                    return 0;
             }
             tf = true;
             FOR(i,n) FOR(j,2) if(a[i][j]!=c[i][j]) { tf = false; }
             if(tf) {
                    cout << 2 << " " << 1 << " " << 4<< " " << 3<< endl;
                    return 0;
             }
    }
    cout << 0 << endl;
    return 0;
}
