#include "bits/stdc++.h"
using namespace std;

long long P, A[3000], F[3000], RF[3000], ANS[3000];

long long Calc(long long A, long long B) {
	if (B == 0) return 1;
	if (B % 2 == 0) {
		long long C = Calc(A, B / 2) % P;
		return (C * C) % P;
	}
	return (A * Calc(A, B - 1)) % P;
}

void init(long long N) {
	F[0] = F[1] = RF[0] = RF[1] = 1;
	for (int i = 2; i <= N; i++) {
		F[i] = (F[i - 1] * i) % P;
		RF[i] = Calc(F[i], P - 2);
	}
	return;
}

long long Comb(long long A, long long B) {
	return ((F[A] * RF[A - B]) % P * RF[B]) % P;
}

int main() {
	cin >> P;
	init(P);
	for (int i = 0; i < P; i++) cin >> A[i];
	for (int i = 0; i < P; i++) {
		if (A[i] == 0) continue;
		long long Cur = 1;
		for (int j = P - 1; j >= 0; j--) {
			if (j % 2 == P % 2) {
				ANS[j] = (ANS[j] + (Comb(P - 1, j) * Cur) % P) % P;
			}
			else {
				ANS[j] = (ANS[j] + P - (Comb(P - 1, j) * Cur) % P) % P;
			}
			Cur = (Cur * i) % P;
		}
		ANS[0] = (ANS[0] + 1) % P;
	}
	for (int i = 0; i < P; i++) {
		cout << ANS[i];
		if (i == P - 1) cout << endl;
		else cout << " ";
	}
}