#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define llint long long #define inf 1e18 #define rep(x, s, t) for(llint (x) = (s); (x) < (t); (x)++) #define Rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++) #define chmin(x, y) (x) = min((x), (y)) #define chmax(x, y) (x) = max((x), (y)) using namespace std; typedef pair P; llint n; llint x[250005], y[250005]; llint cnt[250005]; llint used[505][505]; set

S; vector ans; int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> n; for(int i = 1; i <= n; i++){ cin >> x[i] >> y[i]; used[x[i]][y[i]] = i; } for(int i = 1; i <= n; i++){ for(int dx = -9; dx <= 9; dx++){ for(int dy = -9; dy <= 9; dy++){ llint nx = x[i] + dx, ny = y[i] + dy; if(nx <= 0 || nx > 500 || ny <= 0 || ny > 500) continue; if(used[nx][ny]) cnt[i]++; } } S.insert(P(cnt[i], i)); } while((llint) ans.size() * 90 < n){ llint id = S.begin()->second; S.erase(S.begin()); ans.push_back(id); used[x[id]][y[id]] = 0; for(int dx = -9; dx <= 9; dx++){ for(int dy = -9; dy <= 9; dy++){ llint nx = x[id] + dx, ny = y[id] + dy; if(nx <= 0 || nx > 500 || ny <= 0 || ny > 500) continue; if(used[nx][ny]){ llint nid = used[nx][ny]; S.erase(P(cnt[nid], nid)); cnt[nid]--; S.insert(P(cnt[nid], nid)); } } } } cout << ans.size() << endl; for(int i = 0; i < ans.size(); i++) cout << ans[i] << " "; cout << endl; return 0; }