Int fa[10001];
Int deep[10001];
//初始化(略)
//找根
Int find(int x)
{
	if(fa[x]==x) return x;
	else
	{
		fa[x]=find(fa[x]);
	}
}
//合并
Int and(int x, int y)
{
	x=find(x);
	y=find(y);
	if(x==y) return;
	if(rank[x]>rank[y])
	{
		fa[y]=x;
	}
	else if(rand[x]<rank[y])
	{
		fa[x]=y;
	}
	else
	{
		++rank[x];
		fa[y]=x;
	}
}