add 1182, harder disjoint set