There are initially N−1 pairs of friends among FJ's N (2≤N≤2⋅105) cows labeled 1…N, forming a tree. The cows are leaving the farm for vacation one by one. On day i, the ith cow leaves the farm, and then all pairs of the ith cow's friends still present on the farm become friends.
For each i from 1 to N, just before the ith cow leaves, how many ordered triples of distinct cows (a,b,c) are there such that none of a,b,c are on vacation, a is friends with b, and b is friends with c?
The first line contains N.
The next N−1 lines contain two integers u_i and v_i denoting that cows u_i and v_i are initially friends (1≤u_i,v_i≤N).
The answers for i from 1 to N on separate lines.