#include <cstdio>

int P, A[3000], C[3000], R[3000];

int main()
{
	scanf ("%d", &P);
	for (int i = 0; i < P; i++) scanf ("%d", &A[i]);

	C[0] = 1;
	for (int i = 1; i < P; i++){
		for (int j = i; j > 0; j--) C[j] = (C[j] + C[j - 1]) % P;
	}

	for (int i = 0; i < P; i++) if (A[i]){
		R[0] = (R[0] + 1) % P;
		for (int j = 0, x = 1; j < P; j++){
			R[P - j - 1] = (R[P - j - 1] + P - x * C[j] % P) % P;
			x = x * (P - i) % P;
		}
	}

	for (int i = 0; i < P; i++) printf ("%d ", R[i]); puts("");

	return 0;
}
