Union Find assignment