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: P = int(input())
  A = list(map(int, input().split()))
  
  Q = [1 for _ in range(P)]
  
  for i in range(P):
      if A[i]:
          for k in range(P):
              if i == k:
                  continue
              Q[i] *= i - k
              Q[i] %= P
      else:
          Q[i] = 0
  
  for i in range(P):
      Q[i] = pow(Q[i], P - 2, P)
  
  F = [0 for _ in range(P + 1)]
  F[0] = 1
  
  for i in range(P):
      tmp = [0 for _ in range(P + 1)]
      for j in range(1, P + 1):
          tmp[j] += F[j - 1]
          tmp[j] %= P
      for j in range(P + 1):
          tmp[j] += F[j] * (-i)
          tmp[j] %= P
      F = tmp
  
  res = [0 for _ in range(P)]
  
  for i in range(P):
      G = [0 for _ in range(P)]
      G[P - 1] = F[P]
      res[P - 1] += Q[i] * G[P - 1]
      res[P - 1] %= P
      for j in range(P - 1)[::-1]:
          G[j] = F[j + 1] + i * G[j + 1]
          G[j] %= P
          res[j] += Q[i] * G[j]
          res[j] %= P
  
  print(*res)
  
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"}]