int fa[maxn];
int n;
int Find(int x){
return x == fa[x] ? x : fa[x] = Find(fa[x]);
}
void uni(int x, int y){
fa[Find(x)] = Find(y);
}
void init(){
rep(i, 0, n) fa[i] = i;
}
int fa[maxn];
int n;
int Find(int x){
return x == fa[x] ? x : fa[x] = Find(fa[x]);
}
void uni(int x, int y){
fa[Find(x)] = Find(y);
}
void init(){
rep(i, 0, n) fa[i] = i;
}