#include<stdio.h>
#include<algorithm>

using namespace std;

FILE *fin,*fout;

pair < int , int > t[10000];
int n,i,x;

int main()
{
 fin=fopen("flojd.in","r");
 fout=fopen("flojd.out","w");
 fscanf(fin,"%d",&n);
 for(i=0;i<n;i++)
 {
  fscanf(fin,"%d",&x,&t[i].first);
  t[i].second=i+1;
 }
 sort(t,t+n);
 for(i=0;i<n && n-1-i>i;i++)
 {
  fprintf(fout,"%d\n",t[i].second);
  if(n-1-i!=i)
   fprintf(fout,"%d\n",t[n-1-i].second);
 }
 return 0;
}
