The operation on union-find sets,and it's the answer of poj1611.http://poj.org/problem?id=1611