{"raw_statement":[{"iden":"problem statement","content":"We have a rooted tree $T$ with $N$ vertices numbered $1$ to $N$. Vertex $1$ is the root, and the parent of vertex $i$ $(2 \\leq i \\leq N)$ is vertex $P_i$.\nA non-empty subset $S$ of the vertex set $V = \\lbrace 1, 2,\\dots, N\\rbrace$ of $T$ is said to be a **good vertex set** when it satisfies the following condition.\n\n*   For every pair of different vertices $(u, v)$ in $S$, the following holds: $u$ is not an ancestor of $v$.\n\nFor each $K = 1, 2, \\dots, N$, find the number, modulo $998244353$, of good vertex sets with exactly $K$ vertices."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 2 \\times 10^5$\n*   $1 \\leq P_i \\lt i$\n*   All values in the input are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$P_2$ $P_3$ $\\dots$ $P_N$"},{"iden":"sample input 1","content":"4\n1 2 1"},{"iden":"sample output 1","content":"4\n2\n0\n0\n\nFor each $1 \\leq K \\leq N$, the good vertex sets of size $K$ are listed below.\n\n*   $K=1$: $\\lbrace 1 \\rbrace, \\lbrace 2 \\rbrace, \\lbrace 3 \\rbrace, \\lbrace 4 \\rbrace$.\n*   $K=2$: $\\lbrace 2, 4 \\rbrace, \\lbrace 3, 4 \\rbrace$.\n*   $K=3,4$: There is none."},{"iden":"sample input 2","content":"6\n1 1 2 2 5"},{"iden":"sample output 2","content":"6\n6\n2\n0\n0\n0"},{"iden":"sample input 3","content":"6\n1 1 1 1 1"},{"iden":"sample output 3","content":"6\n10\n10\n5\n1\n0"},{"iden":"sample input 4","content":"10\n1 2 1 2 1 1 2 6 9"},{"iden":"sample output 4","content":"10\n30\n47\n38\n16\n3\n0\n0\n0\n0"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}