#include <bits/stdc++.h>
using namespace std;
using Int = long long;
int main() {
    Int P; cin >> P;
    vector<Int> A(P); for (auto &a : A) cin >> a;
    vector<Int> fac(P), inv(P), finv(P);
    fac[0] = finv[0] = fac[1] = inv[1] = finv[1] = 1;
    for (int i = 2; i < P; i++) {
        fac[i] = fac[i - 1] * i % P;
        inv[i] = (P - 1) * (P / i) * inv[P % i] % P;
        finv[i] = finv[i - 1] * inv[i] % P;
    }
    auto comb = [&](int n, int r) {
        if (n < r || n < 0 || r < 0) return 0LL;
        return fac[n] * finv[n - r] % P * finv[r] % P;
    };
    vector<Int> B(P);
    for (int i = 0; i < P; i++) if (A[i]) {
        Int a = P - i, aa = 1;
        for (int j = P-1; j >= 0; j--) {
            if (j == 0) B[j]++;
            B[j] += comb(P-1, j) * aa * (P-1);
            B[j] %= P;
            aa = aa * a % P;
        }
    }
    for (int i = 0; i < P; i++) {
        cout << B[i] << " \n"[i == P-1];
    }
    return 0;
}
