def unite(self, u, v):
    ru = self.find_root(u)
    rv = self.find_root(v)
    if (ru == rv):
        return
    hu = self.height[ru]
    hv = self.height[rv]
    if (hu >= hv):
        self.root[rv] = ru
        self.size[ru] += self.size[rv]
        self.height[ru] = max(hu, (hv + 1))
    else:
        self.root[ru] = rv
        self.size[rv] += self.size[ru]
def unite(self, u, v):
    ru = self.find_root(u)
    rv = self.find_root(v)
    if (ru == rv):
        return
    hu = self.height[ru]
    hv = self.height[rv]
    if (hu >= hv):
        self.root[rv] = ru
        self.size[ru] += self.size[rv]
        self.height[ru] = max(hu, (hv + 1))
    else:
        self.root[ru] = rv
        self.size[rv] += self.size[ru]