Given a rooted tree on $$$n$$$ vertices with values $$$a_1, \dots, a_n$$$ written on the vertices, we define the score of a vertex as the product of $$$a_u$$$ for all vertices $$$u$$$ in the subtree of $$$v$$$.
However, you've lost the tree and just the values remain. All you remember is the following,
Even though there are $$$(n - 1)!$$$ such trees possible, you try to compute the score of each vertex using just this information.
Output the expected score, modulo $$$998\,244\,353$$$, of each vertex on uniformly randomly sampling a tree satisfying the above constraints.
Formally, let $$$M = 998\,244\,353$$$. It can be shown that the expected score can be expressed as an irreducible fraction $$$\frac{p}{q}$$$, where $$$p$$$ and $$$q$$$ are integers and $$$q \not \equiv 0 \pmod{M}$$$. Output the integer equal to $$$p \cdot q^{-1} \bmod M$$$. In other words, output an integer $$$x$$$ such that $$$0 \le x \lt M$$$ and $$$x \cdot q \equiv p \pmod{M}$$$.
The first line contains an integer $$$n$$$ ($$$2 \le n \le 2 \times 10^5$$$), the size of the lost tree.
The second line contains $$$n$$$ space-separated integers $$$a_1, \dots, a_n$$$ ($$$0 \le a_i \lt 998\,244\,353$$$), $$$a_i$$$ being the value written on the $$$i$$$-th vertex.
Output $$$n$$$ integers, the expected score of the vertices $$$1, 2, \dots, n$$$ in that order.
24 2
8 2
41 2 3 4
24 11 6 4
In sample 2, the following 6 trees are possible