{"raw_statement":[{"iden":"problem statement","content":"Given are a prime number $p$ and a sequence of $p$ integers $a_0, \\ldots, a_{p-1}$ consisting of zeros and ones.\nFind a polynomial of degree at most $p-1$, $f(x) = b_{p-1} x^{p-1} + b_{p-2} x^{p-2} + \\ldots + b_0$, satisfying the following conditions:\n\n*   For each $i$ $(0 \\leq i \\leq p-1)$, $b_i$ is an integer such that $0 \\leq b_i \\leq p-1$.\n*   For each $i$ $(0 \\leq i \\leq p-1)$, $f(i) \\equiv a_i \\pmod p$."},{"iden":"constraints","content":"*   $2 \\leq p \\leq 2999$\n*   $p$ is a prime number.\n*   $0 \\leq a_i \\leq 1$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$p$\n$a_0$ $a_1$ $\\ldots$ $a_{p-1}$"},{"iden":"sample input 1","content":"2\n1 0"},{"iden":"sample output 1","content":"1 1\n\n$f(x) = x + 1$ satisfies the conditions, as follows:\n\n*   $f(0) = 0 + 1 = 1 \\equiv 1 \\pmod 2$\n*   $f(1) = 1 + 1 = 2 \\equiv 0 \\pmod 2$"},{"iden":"sample input 2","content":"3\n0 0 0"},{"iden":"sample output 2","content":"0 0 0\n\n$f(x) = 0$ is also valid."},{"iden":"sample input 3","content":"5\n0 1 0 1 0"},{"iden":"sample output 3","content":"0 2 0 1 3"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}