#include <bits/stdc++.h>
using namespace std;
#define ll long long


int main(){
    int p;
    cin >> p;
    vector<int> a(p);
    for (int i = 0; i < p; i++) cin >> a[i];
    vector<int> comb(p, 0);
    comb[0] = 1;
    for (int i = 1; i < p; i++) {
        comb[i] = 1;
        for (int j = i-1; j >= 1; j--) {
            comb[j] = (comb[j]+comb[j-1])%p;
        }
        comb[0] = 1;
    }
    
    vector<int> ans(p, 0);
    for (int i = 0; i < p; i++) {
        if (a[i] == 0) continue;
        ans[0] += 1;
        int d = 1;
        for (int j = p-1; j >= 0; j--) {
            ans[j] = (ans[j]-d*comb[j])%p;
            d = d*(-i)%p;
        }
    }
    for (int i = 0; i < p; i++) {
        cout << (ans[i]%p+p)%p;
        if (i < p-1) cout << ' ';
        else cout << endl;
    }
    return 0;
}