#include #define rep(i,n) for (int i = 0; i < (int)(n); i ++) #define irep(i,n) for (int i = (int)n - 1;i >= 0;--i) using namespace std; using ll = long long; using PL = pair; using P = pair; constexpr int INF = 1000000000; constexpr long long HINF = 1000000000000000; constexpr long long MOD = 1000000007;// = 998244353; constexpr double EPS = 1e-4; constexpr double PI = 3.14159265358979; int main() { int N; cin >> N; vector> grid(500,vector(500,0)); rep(i,N) { int x,y; cin >> x >> y; grid[x - 1][y - 1] = i + 1; } int K = 0; vector ans; int ny = 0,nx = 0; while (K*90 < N) { bool flag = false; for (int y = ny;y < ny + 10;++y) { for (int x = nx; x < nx + 10;+x) { if (grid[y][x] > 0) { ans.push_back(grid[y][x]); flag = true; ++K; ny = y + 20; if (ny > 500) { ny = 0; nx += 20; } break; } } if (flag) break; } } cout << K << '\n'; rep(i,K) cout << ans[i] << ' '; cout << '\n'; return 0; }