#include using namespace std; #define rep(i,a,b) for(int i=a;i>N; vector> p(90); rep(i,0,N){ int x,y; cin>>x>>y; int A=(x%9)*10+(x*4+y)%10; p[A].push_back(i+1); } int D=(N+89)/90; for(auto x:p){ if(D<=(int)(x.size())){ cout<