2-clustering-big. move UnionFind to common