#include <iostream>
using namespace std;

long long p, nr[3009][3009], a[3009], b[3009];

void init() {
	for (int i = 0; i <= p; i++) {
		for (int j = 0; j <= p; j++) {
			if (i == 0 || j == 0) nr[i][j] = 1;
			else nr[i][j] = (nr[i - 1][j] + nr[i][j - 1]) % p;
		}
	}
}

int main() {
	cin >> p; init();
	for (int i = 0; i < p; i++) {
		cin >> a[i];
		if (a[i] == 1) {
			long long r = 1;
			for (int j = p - 1; j >= 0; j--) {
				b[j] -= r * nr[p - 1 - j][j];
				b[j] += p * p; b[j] %= p;
				r *= -i; r += p * p; r %= p;
			}
			b[0] = (b[0] + 1) % p;
		}
	}
	for (int i = 0; i < p; i++) {
		if (i >= 1) cout << " ";
		cout << b[i];
	}
	cout << endl;
	return 0;
}