############################################################# import sys sys.setrecursionlimit(10**7) from heapq import heappop,heappush from collections import deque,defaultdict,Counter from bisect import bisect_left, bisect_right from itertools import product,combinations,permutations ipt = sys.stdin.readline def iin(): return int(ipt()) def lmin(): return list(map(int,ipt().split())) class dsu: def __init__(self,n): self.N = n self.cnt=[1]*self.N self.root=list(range(self.N)) self.components = self.N def unite(self,x,y): x=self.leader(x) y=self.leader(y) if x!=y: self.components -= 1 if self.cnt[x]