#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#define int long long
#define gmax(x,y) x=max(x,y)
#define gmin(x,y) x=min(x,y)
#define F first
#define S second
#define P pair
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define rep(i,a,b) for(int i=a;i<b;i++)
#define V vector
#define RE return
#define ALL(a) a.begin(),a.end()
#define MP make_pair
#define PB emplace_back
#define PF emplace_front
#define FILL(a,b) memset(a,b,sizeof(a))
#define lwb lower_bound
#define upb upper_bound
using namespace std;
int inv[3005],finv[3005],f[3005],mod,n,po[3005][3005];
void init(){
	finv[1]=1;f[0]=1;f[1]=1;finv[0]=1;inv[1]=1;
	FOR(i,2,n){
		inv[i]=mod-inv[mod%i]*(mod/i)%mod;
		finv[i]=finv[i-1]*inv[i]%mod;
		f[i]=f[i-1]*i%mod;
	}
}
int C(int x,int y){
	RE f[x]*finv[y]*finv[x-y]; 
}
int ans[3005];
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin>>n;mod=n;
	init();
	bool x;
	int t;
	FOR(i,0,n){
		po[i][0]=1;
		FOR(j,1,n){
			po[i][j]=po[i][j-1]*i%mod;
		}
	}
	FOR(i,1,n){
		cin>>x;
		if(!x)continue;
		FOR(j,1,n){
			t=po[n-i+1][n-j];
			t=t*C(n-1,j-1)%mod;
			ans[j]=(ans[j]-t+mod)%mod;
		}
		ans[1]=(ans[1]+1)%mod;
	}
	FOR(i,1,n)cout<<ans[i]<<' ';
	RE 0;
}


