ll n,x,y,a[90][3d5],c;{rd(n);rep(i,n)rd(x,y),a[x=(x+y/9*5)%10*9+y%9][++*a[x]]=i+1,c=*a[x]*90/n?x:c;wt(a[c](*a[c]+1));}