import sys sys.setrecursionlimit(10**7) import pypyjit pypyjit.set_param('max_unroll_recursion=-1') N=int(input()) G=[[] for _ in range(N)] for _ in range(N-1): u,v=map(int,input().split()) u-=1;v-=1 G[u].append(v) G[v].append(u) P=set() def dfs(s,n,c): global P if s!=n:P.add((s,n) if s