#include <bits/stdc++.h>
#define reint register int
#define coint const int
using namespace std;
typedef long long ll;
coint SIZE = 3000 + 5;
ll c[SIZE][SIZE];
ll li[SIZE], ans[SIZE];
ll xpow[SIZE];
int main(void) {
	int n;
	scanf("%d", &n);
	for (reint i = 0; i < n; ++i) scanf("%lld", &li[i]);
	for (reint i = 0; i <= n; ++i) {
		c[i][0] = 1;
		for (reint j = 1; j <= i; ++j)
			c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % n;
	}
	for (reint i = 0; i < n; ++i) {
		if (!li[i]) continue;
		ans[0] = (ans[0] + 1) % n;
		xpow[0] = 1;
		for (reint j = 1; j <= n; ++j) xpow[j] = xpow[j - 1] * (n - i) % n;
		for (reint j = 0; j < n; ++j)
			ans[j] = ((ans[j] - xpow[n - 1 - j] * c[n - 1][j]) % n + n) % n;
	}
	for (reint i = 0; i < n; ++i)
		printf("%lld%c", ans[i], " \n"[i == n - 1]);
	return 0;
}