#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define elif else if
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll MOD2 = 998244353;
const ll INF = 1e18;

int main(){
    int p;
    cin >> p;
    ll n = p-1, m = p, inv[n+1];
    rep2(i, 1, n+1){
        inv[i] = 1;
        ll e[31];
        e[0] = i;
        rep2(j, 1, 30) e[j] = (e[j-1]*e[j-1]) % m;
        ll k = m-2;
        int count = 0;
        while(k > 0){
            if(k % 2 == 1) inv[i] *= e[count], inv[i] %= m;
            k /= 2;
            count++;
        }
    }
    ll fac[p], invfac[p];
    fac[0] = 1, invfac[0] = 1;
    rep2(i, 1, p-1){
        fac[i] = (fac[i-1]*i)%p;
        invfac[i] = (invfac[i-1]*inv[i])%p;
    }
    ll a[p], b[p];
    fill_n(b, p, 0);
    rep(i, p){
        cin >> a[i];
        if(a[i] == 0) continue;
        b[0]++;
        ll ex[p];
        ex[0] = 1;
        rep2(j, 1, p-1) ex[j] = (ex[j-1]*(p-i))%p;
        rep(j, p){
            ll s = ex[p-1-j]*fac[p-1]*invfac[p-1-j]*invfac[j];
            s %= p;
            b[j] += p-s;
            b[j] %= p;
        }
    }
    rep(i, p) cout << b[i] << endl;
}