#abc287f. [abc287_f]Components

[abc287_f]Components

Problem Statement

You are given a tree with NN vertices. The vertices are numbered 11 through NN, and the ii-th edge connects vertex aia_i and vertex bib_i.

Solve the following problem for each x=1,2,ldots,Nx=1,2,\\ldots,N:

  • There are (2N1)(2^N-1) non-empty subsets VV of the tree's vertices. Find the number, modulo 998244353998244353, of such VV that the subgraph induced by VV has exactly xx connected components.

What is an induced subgraph? Let SS be the subset of the vertices of a graph GG; then the subgraph of GG induced by SS is a graph whose vertex set is SS and whose edge set consists of all edges of GG whose both ends are contained in SS.

Constraints

  • 1leqNleq50001 \\leq N \\leq 5000
  • 1leqailtbileqN1 \\leq a_i \\lt b_i \\leq N
  • The given graph is a tree.

Input

The input is given from Standard Input in the following format:

NN a1a_1 b1b_1 vdots\\vdots aN1a_{N-1} bN1b_{N-1}

Output

Print NN lines.
The ii-th line should contain the answer for x=ix=i.


Sample Input 1

4
1 2
2 3
3 4

Sample Output 1

10
5
0
0

The induced subgraph will have two connected components in the following five cases and one in the others.

  • V=1,2,4V = \\{1,2,4\\}
  • V=1,3V = \\{1,3\\}
  • V=1,3,4V = \\{1,3,4\\}
  • V=1,4V = \\{1,4\\}
  • V=2,4V = \\{2,4\\}

Sample Input 2

2
1 2

Sample Output 2

3
0

Sample Input 3

10
3 4
3 6
6 9
1 3
2 4
5 6
6 10
1 8
5 7

Sample Output 3

140
281
352
195
52
3
0
0
0
0