#include #include #include using namespace std; int N, X[250009], Y[250009]; vector idx[100]; int main() { cin >> N; for (int i = 1; i <= N; i++) { cin >> X[i] >> Y[i]; int t1 = X[i] % 9, t2 = Y[i] % 10; idx[t1 * 10 + t2].push_back(i); } 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; }