Do Use FFT

아직 제출이 없습니다시간 제한10초메모리 제한1024 MB

문제

You are given integer sequences AA, BB, and CC, each of length NN. For each k=1,2,,Nk=1,2,\ldots,N, find the following value modulo 998244353998244353.

_1iN(C_i×_1jk(A_i+B_j))\sum\_{1 \leq i \leq N} \left( C\_i \times \prod\_{1 \leq j \leq k} (A\_i+B\_j) \right)

입력

The first line contains an integer NN (1N2500001 \leq N \leq 250000).

The second line contains NN integers A_1,A_2,,A_NA\_1,A\_2,\ldots,A\_N (0A_i<9982443530 \leq A\_i < 998244353).

The third line contains NN integers B_1,B_2,,B_NB\_1,B\_2,\ldots,B\_N (0B_i<9982443530 \leq B\_i < 998244353).

The fourth line contains NN integers C_1,C_2,,C_NC\_1,C\_2,\ldots,C\_N (0C_i<9982443530 \leq C\_i < 998244353).

출력

For each k=1,2,,Nk=1,2,\ldots,N, print the answer.