Circus
The n cows of Farmer John's Circus are preparing their upcoming acts. The acts all take place on a tree with vertices labeled 1..n. The "starting state" of an act is defined by a number k (1 ≤ k ≤ n) and an assignment of cows 1..k to the vertices of the tree, so that no two cows are located at the same vertex.
In an act, the cows make an arbitrarily large number of "moves." In a move, a single cow moves from her current vertex to an unoccupied adjacent vertex. Two starting states are said to be equivalent if one may be reached from the other by some sequence of moves.
For each k (1 ≤ k ≤ n), help the cows determine the number of equivalence classes of starting states: that is, the maximum number of starting states they can pick such that no two are equivalent. Since these numbers may be very large, output their remainders modulo 10^9
+ 7.
Input
Line 1 contains n (1 ≤ n ≤ 10^5
).
Line i (2 ≤ i ≤ n) contain two integers a[i]
and b[i]
denoting an edge between a[i]
and b[i]
in the tree.
Output
For each i (1 ≤ i ≤ n), the i-th line of output should contain the answer for k = i modulo 10^9
+ 7.
Example 1
For k = 1 and k = 2, any two states can be transformed into one another. Now consider k = 3, and let c[i]
denote the location of cow i. The state (c[1]
, c[2]
, c[3]
) = (1, 2, 3) is equivalent to the states (1, 2, 5) and (1, 3, 2). However, it is not equivalent to the state (2, 1, 3).