#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;(i)--)
#define rrep1(i,n) for(int i=((int)(n));i>0;(i)--)
#define sz(c) ((int)(c).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define fi first
#define se second

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> P;
typedef pair<int, pair<int, int> > PP;
//const int MAX=;

int p;
int a[3005];
void input(){
    cin>>p;
    rep(i,p)cin>>a[i];
}

int pol[3005];
int ans[3005];
void solve(){
    pol[p]=1;
    pol[1]=p-1;
    rep(j,p)if(a[j]==1){
        int tmp[3005];
        rep(k,p+1)tmp[k]=pol[k];
        for(int i=p; i>=1; i--){
            tmp[i-1]=(tmp[i-1]+tmp[i]*j)%p;
        }
        rep(i,p)ans[i]=(ans[i]+tmp[i+1])%p;
    }
    rep(i,p)cout<<(p-ans[i])%p<<" ";
}

void output(){
  
}

int main(){
  input();
  solve();
  output();
}