// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



int64_t MOD;

void add(int64_t& a, int64_t b){

    a = ((a+b)%MOD + MOD) % MOD;

}

void mul(int64_t& a, int64_t b){

    a = a*b % MOD;

}



vector<int64_t> fact, seq_inv, fact_inv;



void create_fact_mod(int num){

    fact[0] = 1;

    fact[1] = 1;

    for(int i=2; i<=num; i++){

        fact[i] = fact[i-1] * i % MOD;

    }

}



void create_seq_inv_mod(int num){

    seq_inv[0] = 1;

    seq_inv[1] = 1;

    for(int i=2; i<=num; i++){

        seq_inv[i] = (MOD - MOD/i) * seq_inv[MOD%i] % MOD;

    }

}



void create_fact_inv_mod(int num){

    fact_inv[0] = 1;

    fact_inv[1] = 1;

    for(int i=2; i<=num; i++){

        fact_inv[i] = fact_inv[i-1] * seq_inv[i] % MOD;

    }

}



void create_mod_tables(int num){

    fact.resize(num+1);

    seq_inv.resize(num+1);

    fact_inv.resize(num+1);

    create_fact_mod(num);

    create_seq_inv_mod(num);

    create_fact_inv_mod(num);

}



int64_t comb_mod(int n, int k){

    return fact[n] * fact_inv[n-k] % MOD * fact_inv[k] % MOD;

}



int64_t perm_mod(int n, int k){

    return fact[n] * fact_inv[n-k] % MOD;

}



int64_t power_mod(int64_t num, int64_t power){

    int64_t prod = 1;

    num %= MOD;

    while(power > 0){

        if(power&1) prod = prod * num % MOD;

        num = num * num % MOD;

        power >>= 1;

    }

    return prod;

}



int64_t extgcd(int64_t a, int64_t b, int64_t& x, int64_t& y){

    int64_t d = a;

    if(b != 0){

        d = extgcd(b, a%b, y, x);

        y -= (a/b) * x;

    }else{

        x = 1; y = 0;

    }

    return d;

}



int64_t inv_mod(int64_t a){

    int64_t x, y;

    extgcd(a, MOD, x, y);

    return (MOD + x%MOD) % MOD;

}



int main(){

    cin >> MOD;

    create_mod_tables(3000);

    vector<int64_t> ans(MOD);

    for(int i=0; i<MOD; i++){

        int a;

        cin >> a;

        if(a){

            add(ans[0], 1);

            int64_t pw = 1;

            for(int k=0; k<MOD; k++){

                int64_t C = (k%2 ? -1 : 1) * comb_mod(MOD-1, k) * pw;

                add(ans[MOD-1-k], -C);

                mul(pw, i);

            }

        }

    }

    for(int i=0; i<MOD; i++) cout << ans[i] << " \n"[i==MOD-1];

    return 0;

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;





int64_t MOD;

void add(int64_t& a, int64_t b){

    a = (a+b) % MOD;

}

void mul(int64_t& a, int64_t b){

    a = a*b % MOD;

}



vector<int64_t> fact, seq_inv, fact_inv;



void create_fact_mod(int num){

    fact[0] = fact[1] = 1;

    for(int i=2; i<=num; i++) fact[i] = fact[i-1] * i % MOD;

}



void create_seq_inv_mod(int num){

    seq_inv[0] = seq_inv[1] = 1;

    for(int i=2; i<=num; i++) seq_inv[i] = (MOD - MOD/i) * seq_inv[MOD%i] % MOD;

}



void create_fact_inv_mod(int num){

    fact_inv[0] = fact_inv[1] = 1;

    for(int i=2; i<=num; i++) fact_inv[i] = fact_inv[i-1] * seq_inv[i] % MOD;

}



void create_mod_tables(int num){

    fact.resize(num+1);

    seq_inv.resize(num+1);

    fact_inv.resize(num+1);

    create_fact_mod(num);

    create_seq_inv_mod(num);

    create_fact_inv_mod(num);

}



int64_t comb_mod(int n, int k){

    return fact[n] * fact_inv[n-k] % MOD * fact_inv[k] % MOD;

}



int64_t perm_mod(int n, int k){

    return fact[n] * fact_inv[n-k] % MOD;

}



int64_t power_mod(int64_t num, int64_t power){

    int64_t prod = 1;

    num %= MOD;

    while(power > 0){

        if(power&1) prod = prod * num % MOD;

        num = num * num % MOD;

        power >>= 1;

    }

    return prod;

}



int64_t extgcd(int64_t a, int64_t b, int64_t& x, int64_t& y){

    int64_t d = a;

    if(b != 0){

        d = extgcd(b, a%b, y, x);

        y -= (a/b) * x;

    }else{

        x = 1; y = 0;

    }

    return d;

}



int64_t inv_mod(int64_t a){

    int64_t x, y;

    extgcd(a, MOD, x, y);

    return (MOD + x%MOD) % MOD;

}



int main(){

    cin >> MOD;

    create_mod_tables(MOD-1);

    vector<int64_t> ans(MOD);

    for(int i=0; i<MOD; i++){

        int p;

        cin >> p;

        if(p){

            add(ans[0], 1);

            int64_t pw = 1;

            for(int j=MOD-1; j>=0; j--){

                int64_t res = pw * comb_mod(MOD-1, j) % MOD;

                if(j%2 == 0) res = MOD-res;

                add(ans[j], res);

                mul(pw, i);

            }

        }

    }

    for(int i=0; i<MOD; i++) cout << ans[i] << " \n"[i==MOD-1];

}


// Fastest known solution for this problem: