#include #include #include #include using namespace std; int N, X[250009], Y[250009]; vector idx[90]; int main() { cin >> N; assert(1 <= N && N <= 250000); for (int i = 1; i <= N; i++) { cin >> X[i] >> Y[i]; assert(1 <= X[i] && X[i] <= 500 && 1 <= Y[i] && Y[i] <= 500); int t1 = X[i] % 9, t2 = Y[i] % 10; if (X[i] % 18 >= 9) t2 = (t2 + 5) % 10; idx[t1 * 10 + t2].push_back(i); } for (int i = 1; i <= N; i++) { for (int j = i + 1; j <= N; j++) assert(make_pair(X[i], Y[i]) != make_pair(X[j], Y[j])); } pair maxn = make_pair(-1, -1); for (int i = 0; i < 90; i++) maxn = max(maxn, make_pair((int)idx[i].size(), i)); cout << idx[maxn.second].size() << endl; for (int i = 0; i < idx[maxn.second].size(); i++) { if (i) cout << " "; cout << idx[maxn.second][i]; } cout << endl; return 0; }