P = gets.to_i
As = gets.split.map(&:to_i)

a, ans = As.dup, Array.new(P, 0)
ans[0] = a[0]
(P - 1).times do |i|
  P.times do |j|
    ans[P - 1 - i] += a[j]
    a[j] = (a[j] * j) % P
  end
  ans[P - 1 - i] = ans[P - 1 - i] % P * (P - 1) % P
end
puts ans.join(' ')