{
TASK:sym
LANG:PASCAL
}
{$R-}
const
 maxn=10001;
 small=0.0001;
type
 dot=record
   x,y,i:integer;
   cs:extended;
  end;
var
 fl:boolean;
 tt:dot;
 x,y,io,izo:array [0..maxn+1] of integer;
 a,b:array [0..maxn+1] of dot;
 u:array [0..maxn+1] of boolean;
 n,m,ii,i,j,k,im,l,mm:longint;
{ t:text;}
 d1,d2,a1,b1,c1,a2,b2,c2,x1,y1,cc,x2,y2,x3,y3,x4,y4:extended;

 Procedure Qsort1(l,r:longint);
 var i1,j1:longint;
      x:extended;
      tt:dot;
 begin
    i1:=l;
    j1:=r;
    x:=a[(i1+j1) div 2].cs;
    repeat
       while a[i1].cs>x do inc(i1);
       while x>a[j1].cs do dec(j1);
       if i1<=j1 then
          begin
             tt:=a[i1];
             a[i1]:=a[j1];
             a[j1]:=tt;
             inc(i1);
             dec(j1);
          end;
    until i1>j1;
    if i1<r then Qsort1(i1,r);
    if l<j1 then Qsort1(l,j1);
 end;

 Procedure Qsort2(l,r:longint);
 var i1,j1:longint;
      x:extended;
      tt:dot;
 begin
    i1:=l;
    j1:=r;
    x:=b[(i1+j1) div 2].cs;
    repeat
       while b[i1].cs>x do inc(i1);
       while x>b[j1].cs do dec(j1);
       if i1<=j1 then
          begin
             tt:=b[i1];
             b[i1]:=b[j1];
             b[j1]:=tt;
             inc(i1);
             dec(j1);
          end;
    until i1>j1;
    if i1<r then Qsort2(i1,r);
    if l<j1 then Qsort2(l,j1);
 end;

 procedure izp(kk:byte);
  var
   a1,b1,c1:extended;
   i,j,k,l:integer;
   s:longint;
  begin
    l:=1;
    for i:=1 to n-1 do
     if not u[i+1] then
      begin
        s:=(a[i+1].x-a[l].x)*(a[i+1].y+a[l].y)+(a[i+2].x-a[i+1].x)*(a[i+2].y+a[i+1].y)+
           (a[l].x-a[i+2].x)*(a[l].y+a[i+2].y);
        if ((s<0)and(kk=1))or((s>0)and(kk=2)) then u[i+1]:=true
        else if s=0 then
         begin
           a1:=sqrt(sqr(a[i+1].x-a[l].x)+sqr(a[i+1].y-a[l].y));
           b1:=sqrt(sqr(a[i+2].x-a[l].x)+sqr(a[i+2].y-a[l].y));
           if a1<b1 then u[i+1]:=true;
           if b1<a1 then u[i+2]:=true;
         end;
        if not u[i+1] then l:=i+1;
      end;
    m:=0;
    for i:=1 to n do
     if not u[i] then begin inc(m); io[m]:=i; end;
  end;

 procedure getmid(i,j:integer; var x1,y1:extended);
 var
  l,k:integer;
 begin
{  if abs(a[io[i]].x)>abs(a[io[j]].x) then
   begin l:=a[io[i]].x; k:=a[io[j]].x; end
   else begin l:=a[io[j]].x; k:=a[io[i]].x; end;}
  l:=a[io[j]].x; k:=a[io[i]].x;
  x1:=(l+k)/2;
{  if abs(a[io[i]].y)>abs(a[io[j]].y) then
   begin l:=a[io[i]].y; k:=a[io[j]].y; end
   else begin l:=a[io[j]].y; k:=a[io[i]].y; end;}
  l:=a[io[j]].y; k:=a[io[i]].y;
  y1:=(l+k)/2;
 end;

procedure yey(iii,jjj:integer);
var
 ffl:boolean;
 ll:longint;
 ttt:dot;
begin
  cc:=sqrt(sqr(a1)+sqr(b1));
  k:=jjj; j:=iii;
  fl:=true;
  for l:=1 to mm do
   begin
     inc(k); dec(j);
     if k>m then k:=1;
     if j<1 then j:=m;
     x1:=a[io[k]].x; y1:=a[io[k]].y;
     x2:=a[io[j]].x; y2:=a[io[j]].y;
     d1:=(a1*x1+b1*y1+c1)/cc;
     d2:=(a1*x2+b1*y2+c1)/cc;
     if abs(d1+d2)>small then
      begin fl:=false; break; end;
     izo[a[io[k]].i]:=a[io[j]].i;
     izo[a[io[j]].i]:=a[io[k]].i;
   end;
  if fl then
   begin
     for j:=1 to n do b[j].cs:=(a1*b[j].x+b1*b[j].y+c1)/cc;
     qsort2(1,n); ll:=n div 2;
     ffl:=false;
     while not ffl do
      begin
        ffl:=true;
        for j:=1 to ll-1 do
         begin k:=j+1;
         while abs(b[k].cs-b[j].cs)<small do begin
         if (abs(b[n-j+1].cs-b[n-k+1].cs)<small) then
          if sqr(b[n-k+1].x-b[j].x)+sqr(b[n-k+1].y-b[j].y)<
             sqr(b[n-k+1].x-b[k].x)+sqr(b[n-k+1].y-b[k].y) then
              begin
                ttt:=b[j];
                b[j]:=b[k];
                b[k]:=ttt;
                ffl:=false;
              end;
         inc(k); end; end;
      end;
     j:=1; k:=n;
     fillchar(izo,sizeof(izo),0);
     while ((abs(b[j].cs)>small)or(abs(b[k].cs)>small))and(k>=j) do
      begin
        if abs(b[j].cs+b[k].cs)>small then begin fl:=false; break; end;
        izo[b[j].i]:=b[k].i;
        izo[b[k].i]:=b[j].i;
        dec(k); inc(j);
      end;
   end;
end;

begin
{  assign(t,'sym1.in');
  reset (t);}
  readln ({t,}n);
  x1:=10001; y1:=10001;
  for i:=1 to n do
   begin
     readln({t,}x[i],y[i]);
     if y[i]<y1 then begin l:=i; x1:=x[i]; y1:=y[i]; end
     else if (y[i]=y1)and(x[i]<x1) then begin l:=i; x1:=x[i]; y1:=y[i]; end;
     a[i].x:=x[i]; a[i].y:=y[i]; a[i].i:=i;
     b[i].x:=x[i]; b[i].y:=y[i]; b[i].i:=i;
   end;
{  close (t);}

  for i:=1 to n do
   if l<>i then
    a[i].cs:=(x[i]-x[l])/sqrt(sqr(x[l]-x[i])+sqr(y[l]-y[i]));
  tt:=a[1];
  a[1]:=a[l];
  a[l]:=tt;
  qsort1(2,n);
  a[n+1]:=a[1];
  izp(2); {if m=2 then begin fillchar(u,sizeof(u),false); izp(2); end;}
  io[m+1]:=io[1];

  mm:=m div 2;
  for i:=1 to m do
   begin
     getmid(i,i+1,x1,y1);
     im:=i+mm; if im>m then im:=im-m;
     if m mod 2=0 then
      getmid(im,im+1,x2,y2)
     else
      begin
        x2:=a[io[im+1]].x;
        y2:=a[io[im+1]].y;
      end;
     a1:=y1-y2; b1:=x2-x1; c1:=x1*y2-x2*y1;
     if (a1<>0)or(b1<>0)or(c1<>0) then
      yey(i,i+1);

     if fl then break;

     x1:=a[io[i]].x; y1:=a[io[i]].y;
     x2:=a[io[im]].x; y2:=a[io[im]].y;
     a1:=y1-y2; b1:=x2-x1; c1:=x1*y2-x2*y1;
     if (a1<>0)or(b1<>0)or(c1<>0) then
      yey(i,i);

     if fl then break;
   end;

  if not fl then writeln(0)
  else
   begin
     for i:=1 to n do if izo[i]=0 then izo[i]:=i;
     for i:=1 to n-1 do
      write(izo[i],' ');
     writeln(izo[n]);
   end;

end.
