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: class Combination:
      """階乗とその逆元のテーブルをO(N)で事前作成し、組み合わせの計算をO(1)で行う"""
  
      def __init__(self, n, MOD):
          self.fact = [1]
          for i in range(1, n + 1):
              self.fact.append(self.fact[-1] * i % MOD)
          self.inv_fact = [0] * (n + 1)
          self.inv_fact[n] = pow(self.fact[n], MOD - 2, MOD)
          for i in reversed(range(n)):
              self.inv_fact[i] = self.inv_fact[i + 1] * (i + 1) % MOD
          self.MOD = MOD
  
      def inverse(self, k):
          """kの逆元を求める O(1)"""
          return (self.inv_fact[k] * self.fact[k - 1]) % self.MOD
  
      def factorial(self, k):
          """k!を求める O(1)"""
          return self.fact[k]
  
      def inverse_factorial(self, k):
          """k!の逆元を求める O(1)"""
          return self.inv_fact[k]
  
      def permutation(self, k, r):
          """kPrを求める O(1)"""
          if k < r:
              return 0
          return (self.fact[k] * self.inv_fact[k - r]) % self.MOD
  
      def combination(self, k, r):
          """kCrを求める O(1)"""
          if k < r:
              return 0
          return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD
  
      def combination2(self, k, r):
          """kCrを求める O(r)
          kが大きいが、r <= nを満たしているときに使用
          """
          if k < r:
              return 0
          res = 1
          for l in range(r):
              res *= k - l
              res %= self.MOD
          return (res * self.inv_fact[r]) % self.MOD
  
  
  p = int(input())
  a = list(map(int, input().split()))
  comb = Combination(p - 1, p)
  
  
  b = [0] * p
  for i in range(p):
      for j in range(p):
          # (x - j) ^ (p - 1) の係数x^iの部分
          tmp = pow(-j, (p - 1 - i), p) * comb.combination(p - 1, i)
          b[i] -= a[j] * tmp
          b[i] %= p
  b[0] = a[0]
  
  print(*b)
  
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"}]