# Log of Formal Power Series

AC一覧

## Problem Statement問題文

You are given a formal power series $f(x) = \sum_{i=0}^{N-1} a_i x^i \in \mathbb{Q}[[x]]$ with $a_0 = 1$. Calculate the first $N$ terms of $\log(f(x)) = \sum_{i=0}^{\infty} b_i x^i$. In other words, find $g(x) = \sum_{i=0}^{N-1} b_i x^i \in \mathbb{Q}[[x]]$ such that

$$f(x) \equiv \sum_{k=0}^{N-1} \frac{g(x)^k}{k!} \pmod{x^N}.$$

Print the coefficients modulo $998{,}244{,}353$.

$$f(x) \equiv \sum_{k=0}^{N-1} \frac{g(x)^k}{k!} \pmod{x^N}$$

となる $g(x) = \sum_{i=0}^{N-1} b_i x^i \in \mathbb{Q}[[x]]$ を求めてください。係数を $\operatorname{mod} 998{,}244{,}353$ で出力してください。

## Constraints制約

• $1 \leq N \leq 500{,}000$
• $0 \leq a_i < 998{,}244{,}353$
• $a_0 = 1$

## Input入力

$N$
$a_0$ $a_1$ $\cdots$ $a_{N - 1}$


## Output出力

$b_0$ $b_1$ $\cdots$ $b_{N - 1}$


## Sampleサンプル

### # 1

5
1 1 499122179 166374064 291154613

0 1 2 3 4


Timelimit: 10 secs

Before submitting, please confirm terms and conditions