#include <bits/stdc++.h>
#define MAX 3010
using namespace std;

int P;
int arr[MAX];
int poly[MAX];

inline int add(int a, int b)
{
	return (a + b) % P;
}

inline int prod(int a, int b)
{
	return a * b % P;
}

int main(void)
{
	cin >> P;
	for (int i = 0; i < P; i++)
	{
		int val;
		cin >> val;
		if (!val) continue;
		arr[P] = 1;
		for (int j = P; j > 0; j--)
		{
			poly[j - 1] = add(poly[j - 1], P - arr[j]);
			arr[j - 1] = prod(arr[j], i);
			if (j == 2) arr[1] = add(arr[1], P - 1);
			arr[j] = 0;
		}
	}
	for (int i = 0; i < P; i++) cout << poly[i] << " ";
	cout << endl;
	return 0;
}
