#include #include #include #include #include #include #include #include #include #include #include using namespace std; #define MOD 1000000007 #define MOD2 998244353 #define INF (1<<29) #define LINF (1LL<<60) #define EPS (1e-10) #define PI 3.1415926535897932384626433832795028 typedef long long Int; typedef pair P; typedef long double Real; typedef complex CP; typedef pair T; Int n; priority_queue, greater

> pq; int ind[550][550]; int deg[550][550]; set edge[260000]; Int x[260000], y[260000]; vector ans; bool done[260000]; int main(){ cin >> n; for(int i = 1;i <= n;i++){ cin >> x[i] >> y[i]; ind[x[i]][y[i]] = i; } for(int i = 0;i <= 500;i++){ for(int j = 0;j <= 500;j++){ if(ind[i][j] == 0)continue; for(int x = max(i-10,0);x <= min(i+10, 500);x++){ for(int y = max(j-10,0);y <= min(j+10, 500);y++){ if((x-i)*(x-i)+(y-j)*(y-j) < 100 && ind[x][y] != 0){ edge[ind[i][j]].insert(ind[x][y]); edge[ind[x][y]].insert(ind[i][j]); } } } pq.push({edge[ind[i][j]].size(),ind[i][j]}); } } while(!pq.empty()){ auto tmp = pq.top();pq.pop(); int index = tmp.second; int deg = tmp.first; if(done[index])continue; if(edge[index].size() < deg)continue; done[index] = true; ans.push_back(index); set changed; for(auto neighb: edge[index]){ done[neighb] = true; for(auto nn: edge[neighb]){ if(nn == neighb)continue; if(edge[nn].count(neighb)){ edge[nn].erase(neighb); changed.insert(nn); } } edge[neighb].clear(); } for(auto x:changed){ if(!done[x]) pq.push({edge[x].size(),x}); } edge[index].clear(); } cout << ans.size() << endl; for(auto ind:ans)cout << ind << " ";cout << endl; return 0; }