#include<bits/stdc++.h>
using namespace std;
int main()
{
int , x, max=0, rs;
cin>>rs;
int a[rs+1],b[rs+1],id[rs+1];
for(int i=1;i<=rs;i++)
cin>>b[i]>>a[i];
sort(b+1,b+1+rs)
for(int i=1;i<=rs;i++)
if(b[i]>=60)
cout<<i<<" ";
a[i]--;}
}
}
for(int i=0;i<=max;i++){
while(a[i]){
if(i%2!=0) break;
if(i%2==0){
cout<<i<<" ";
a[i]--; }
}
}
return 0;
}