{
TASK:green
LANG:PASCAL
}
{$N+}
{$R-}
type
 tip=extended;
var
 t:text;
 x,y:array [1..100] of longint;
 i,j,k,l:longint;
 min,s:tip;
 m,mm:byte;

 function lice(x1,y1,x2,y2,x3,y3:longint):tip;
  var
   p,a,b,c:tip;
  begin
    if x1<>x2 then if y1<>y2 then a:=sqrt(sqr((x1-x2))+sqr((y1-y2)))
    else a:=abs(x1-x2) else a:=abs(y1-y2);
    if x2<>x3 then if y2<>y3 then b:=sqrt(sqr((x2-x3))+sqr((y2-y3)))
    else b:=abs(x2-x3) else b:=abs(y2-y3);
    if x3<>x1 then if y3<>y1 then c:=sqrt(sqr((x3-x1))+sqr((y3-y1)))
    else c:=abs(x3-x1) else c:=abs(y3-y1);
    if (a>0)and(b>0)and(c>0) then
     begin
       p:=(a+b+c)/2;
       lice:=sqrt(p*(p-a)*(p-b)*(p-c));
     end
    else
     lice:=0;
  end;

begin
  assign (t,{'green.in'}'');
  reset (t);
  k:=0;
  mm:=101;
  repeat
    read (t,m);
    if m>0 then begin read (t,x[1],y[1],x[2],y[2]);
    s:=0; inc(k);
    for i:=3 to m do
     begin
       read (t,x[i],y[i]);
       s:=s+lice(x[1],y[1],x[i-1],y[i-1],x[i],y[i])
     end;
    if (min=0)or(s<min)or((s=min)and(m<mm)) then begin min:=s; mm:=m; j:=k; end; end;
  until m=0;
  close (t);

  assign (t,'');
  rewrite (t);
  writeln (t,j);
  close (t);
end.