write simple disjoint set