#line 1 "main.cpp" /** * @title Template */ #include #include #include #include #include #include template inline bool chmin(T &lhs, const U &rhs) { if (lhs > rhs) { lhs = rhs; return true; } return false; } template inline bool chmax(T &lhs, const U &rhs) { if (lhs < rhs) { lhs = rhs; return true; } return false; } struct range { using itr = int64_t; struct iterator { itr i; constexpr iterator(itr i_) noexcept : i(i_) { } constexpr void operator ++ () noexcept { ++i; } constexpr itr operator * () const noexcept { return i; } constexpr bool operator != (iterator x) const noexcept { return i != x.i; } }; const iterator l, r; constexpr range(itr l_, itr r_) noexcept : l(l_), r(std::max(l_, r_)) { } constexpr iterator begin() const noexcept { return l; } constexpr iterator end() const noexcept { return r; } }; struct revrange { using itr = int64_t; struct iterator { itr i; constexpr iterator(itr i_) noexcept : i(i_) { } constexpr void operator ++ () noexcept { --i; } constexpr itr operator * () const noexcept { return i; } constexpr bool operator != (iterator x) const noexcept { return i != x.i; } }; const iterator l, r; constexpr revrange(itr l_, itr r_) noexcept : l(l_ - 1), r(std::max(l_, r_) - 1) { } constexpr iterator begin() const noexcept { return r; } constexpr iterator end() const noexcept { return l; } }; using i32 = int32_t; using i64 = int64_t; using u32 = uint32_t; using u64 = uint64_t; constexpr i32 inf32 = (i32(1) << 30) - 1; constexpr i64 inf64 = (i64(1) << 62) - 1; int main() { size_t N; std::cin >> N; std::vector X(N), Y(N); auto idx = [] { std::vector> arr(500, std::vector(500)); for (auto i: range(0, 500)) { for (auto j: range(0, 500)) { i32 x = i % 10; i32 y = j % 9; i32 z = j / 9; arr[i][j] = 10 * y + (x + z) % 10; } } return arr; }(); // for (auto i: range(0, 30)) { // for (auto j: range(0, 30)) { // std::cout << idx[i][j] << ' '; // } // std::cout << '\n'; // } std::array, 90> group{}; for (auto i: range(0, N)) { std::cin >> X[i] >> Y[i]; --X[i]; --Y[i]; group[idx[X[i]][Y[i]]].push_back(i); } for (auto &vec: group) { if (vec.size() * 90 >= N) { std::cout << vec.size() << '\n'; for (auto i: range(0, vec.size())) { std::cout << vec[i] + 1 << (i + 1 == vec.size() ? '\n' : ' '); } return 0; } } return 0; }