#include "sphinx.h"
#include<bits/stdc++.h>
using namespace std;
//int perform_experiment(vector<int>E);
const int MAXN=255;
vector<int> e[MAXN];
int fa[MAXN];
int find(int x){
return x==fa[x]?x:fa[x]=find(fa[x]);
}
void merge(int x,int y){
x=find(x),y=find(y);
fa[x]=y;
}
int cnt[MAXN];
vector<int> find_colours(int N,vector<int>X,vector<int>Y) {
int M=X.size();
for(int i=0;i<M;++i){
e[X[i]].push_back(Y[i]);
e[Y[i]].push_back(X[i]);
}
for(int i=0;i<N;++i)
fa[i]=i;
cnt[0]=1;
for(int i=1;i<N;++i){
vector<int> now(N,N);
for(int j=0;j<=i;++j)
now[j]=-1;
int ret=perform_experiment(now);
if(ret==cnt[i-1]+1){
cnt[i]=cnt[i-1]+1;
continue;
}
int l=0,r=i-1,mid=(l+r)>>1;
while(l<r){
for(int j=0;j<=mid;++j)
now[j]=-1;
for(int j=mid+1;j<i;++j)
now[j]=N;
now[i]=-1;
for(int j=i+1;j<N;++j)
now[j]=N;
ret=perform_experiment(now);
if(ret==cnt[mid]+1)
r=mid;
else l=mid+1;
mid=(l+r)>>1;
}
merge(i,l);
cnt[i]=cnt[i-1];
}
vector<int> ans(N);
for(int i=0;i<N;++i)
ans[i]=find(i);
return ans;
}