/*
TASK: green
LANG: C++
*/

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

 using namespace std;
 
 struct point{
    double x;
    double y;
    point(double t1=0, double t2=0){ x = t1; y = t2; }
 };
 
 struct poly{
    int n;
    vector<point> a;
 };
 
 poly T;
 double minn = 999999;
 int s, r;
 
 bool read(){
    cin >> T.n; if( T.n == 0 ) return false;
    for(int i = 0; i < T.n; ++i)
        cin >> T.a[i].x >> T.a[i].y;
    return true;
 }

 inline double lice(point P1, point P2, point P3){
    return fabs((P3.y-P1.y)*(P2.x-P1.x)-(P3.x-P1.x)*(P2.y-P1.y))/2;
 }

 double compute(){
    double ss = 0;
    for(int i = 1; i < T.n-1; ++i)
        ss += lice(T.a[0], T.a[i], T.a[i+1]);
    return ss;
 }
 
 int main(){
    T.a.resize(128);    
    int k = 1;
    while ( read() ){
        double t = compute();
//      cout << t << '\n';
        if(t < minn) {
            minn = t; s = T.n; r = k;
        }
        if( t == minn && T.n < s ){
            minn = t; s = T.n; r = k;
        }
        ++k;
    }
    cout << r << '\n';
    return 0;
 }
