Problem9968--ABC315 —— Ex - Typical Convolution Problem

9968: ABC315 —— Ex - Typical Convolution Problem

[Creator : ]
Time Limit : 2.000 sec  Memory Limit : 512 MiB

Description

You are given a sequence $(A_1, A_2, \ldots , A_N)$. Let us define a sequence $(F_0, F_1, \ldots , F_N)$ by the following formulae.

-   $F_0 = 1$
-   $F_n = A_n\displaystyle\sum_{i+j<n}F_iF_j$ $(1 \leq n \leq N)$

Find $F_1, \ldots , F_N$ modulo $998244353$.

Input

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

```
$N$
$A_1$ $A_2$ $\ldots$ $A_N$
```

Output

Print $F_1, \ldots , F_N$ modulo $998244353$ in this order, with spaces in between.

Constraints

-   $1 \leq N \leq 2 \times 10^5$
-   $0 \leq A_i < 998244353$
-   All input values are integers.

Sample 1 Input

5
1 2 3 4 5

Sample 1 Output

1 6 48 496 6240

Sample 2 Input

3
12345 678901 2345678

Sample 2 Output

12345 790834943 85679169

Source/Category