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: import sys
  
  sys.setrecursionlimit(2147483647)
  INF = float("inf")
  MOD = 10**9 + 7
  input = lambda: sys.stdin.readline().rstrip()
  
  
  def resolve():
      # preparation
      p = int(input())
      invfact = [0] * p
      invfact[p - 1] = p - 1  # Wilson's theorem
      for i in range(2, p):
          invfact[p - i] = invfact[p - i + 1] * (p - i + 1) % p
  
      # initialize
      A = list(map(int, input().split()))
      ans = [0] * p
      ans[0] = A[0]
      r = [0] * (p + 1)  # for use of r[-1]=0
      r[0] = 1
  
      # iterate
      for k in range(1, p):
          newr = [0] * (p + 1)  # newr(x)=(x-(k-1))r(x)
          v = 0  # v=f[k-1](k)
          power = 1
          for i in range(p):
              v += ans[i] * power % p
              power *= k
              power %= p
              newr[i] = (r[i - 1] - (k - 1) * r[i]) % p
          r = newr
          for i in range(p):
              ans[i] += (A[k] - v) * invfact[k] * r[i]
              ans[i] %= p
      print(*ans)
  
  
  resolve()
  
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"}]