{"raw_statement":[{"iden":"note","content":"This problem is a **hard challenge intended for those who have finished all other problems and still have time left**.  \nThe score is set relatively low compared to its difficulty.  \nIf you have not solved the other problems yet, it is recommended to do those first."},{"iden":"problem statement","content":"You are given a formal power series $F(x) = \\sum_{i=0}^{N-1} f_i x^i$ over $\\mathbb{F} _ {998244353}$, where $N \\geq 2$ and $F(x) \\bmod{x^2} = x$.\nIt can be proven that there exists a unique formal power series $G(x) = \\sum_{i=0}^{N-1} g_i x^i$ over $\\mathbb{F} _ {998244353}$ such that:\n\n*   $G(G(x)) \\equiv F(x) \\pmod{x^N}$, and\n*   $G(x) \\bmod{x^2} = x$.\n\nYour task is to find this $G(x)$."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 8000$\n*   $f_0 = 0$\n*   $f_1 = 1$\n*   $0 \\leq f_i < 998244353$ for $2 \\leq i \\leq N-1$\n*   All input values are integers"},{"iden":"input","content":"The input is given from standard input in the following format:\n\n$N$\n$f_0$ $f_1$ $\\dots$ $f_{N-1}$"},{"iden":"sample input 1","content":"3\n0 1 4"},{"iden":"sample output 1","content":"0 1 2\n\n$G(x) = x + 2x^2$ satisfies the conditions."},{"iden":"sample input 2","content":"7\n0 1 766294629 440423913 59187619 725560240 585990756"},{"iden":"sample output 2","content":"0 1 882269491 824730961 772850352 694658399 134447547"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}