local mfl, mce = math.floor, math.ceil
local p = io.read("*n")
local function badd(x, y) return (x + y) % p end
local function bmul(x, y) return (x * y) % p end

local a = {}
for i = 1, p do
  a[i] = io.read("*n")
end
local poldst = {}
for i = 1, p do
  poldst[i] = 0
end

local fact = {1}
local invs = {1}
local invfact = {1}
for i = 2, p - 1 do
  fact[i] = bmul(fact[i - 1], i)
  invs[i] = bmul(mfl(p / i), p - invs[p % i])
  invfact[i] = bmul(invfact[i - 1], invs[i])
end

for i = 0, p - 1 do
  local v = a[i + 1]
  if 0 < i then
    v = bmul(v, invfact[i])
  end
  if i < p - 1 then
    v = bmul(v, invfact[p - 1 - i])
    if (p - 1 - i) % 2 == 1 then
      v = (p - v) % p
    end
  end
  local pol = {}
  pol[1] = 1
  for j = 2, p do pol[j] = 0 end
  for j = 0, p - 1 do
    if i ~= j then
      for k = p, 1, -1 do
        if 1 < k then
          pol[k] = badd(pol[k - 1], bmul(pol[k], p - j))
        else
          pol[1] = bmul(pol[1], p - j)
        end
      end
    end
  end
  for j = 1, p do
    poldst[j] = badd(poldst[j], bmul(v, pol[j]))
  end
end
print(table.concat(poldst, " "))
