output_description: Print b_0, b_1, \ldots, b_{p-1} of a polynomial f(x) satisfying the
  conditions, in this order, with spaces in between.
  
  It can be proved that a solution always exists. If multiple solutions exist,
  any of them will be accepted.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      p
      a_0 a_1 \ldots a_{p-1}
attempt: def solve():
      p = int(input())
      (*A,) = map(int, input().split())
  
      L = p - 1
      fact = [1] * (L + 1)
      rfact = [1] * (L + 1)
      r = 1
      for i in range(1, L + 1):
          fact[i] = r = r * i % p
      rfact[L] = r = pow(r, p - 2, p)
      for i in range(L, 0, -1):
          rfact[i - 1] = r = r * i % p
      V = [(-fact[p - 1] * rfact[k] * rfact[p - 1 - k]) % p for k in range(p)]
  
      R = [0] * p
      I = [i for i, a in enumerate(A) if a]
      C = [a for a in A]
  
      for k in range(p):
          R[k] = V[k] * sum(C) % p
  
          for i in I:
              C[i] = C[i] * -i % p
      R[-1] = (R[-1] + len(I)) % p
      R.reverse()
      print(*R)
  
  
  solve()
  
problem_description: Statement
  
  Given are a prime number p and a sequence of p integers a_0, \ldots, a_{p-1}
  consisting of zeros and ones.
  
  Find 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:
  
    * For each i (0 \leq i \leq p-1), b_i is an integer such that 0 \leq b_i \leq p-1.
    * For each i (0 \leq i \leq p-1), f(i) \equiv a_i \pmod p.
samples: [{"input": "2\n    1 0", "output": "1 1\n    \n\nf(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\n\n* * *"}, {"input": "3\n    0 0 0", "output": "0 0 0\n    \n\nf(x) = 0 is also valid.\n\n* * *"}, {"input": "5\n    0 1 0 1 0", "output": "0 2 0 1 3"}]