#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;

//static const long long mod = 1000000007;
static long long mod = 2;
struct mint {
  long long x;
  //mint(ll x = 0):x(x%mod) {}
  mint(ll x = 0):x((x%mod+mod)%mod) {} // for minus
  mint& operator+=(const mint a) {
    (x += a.x) %= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    (x += mod-a.x) %= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint ret(*this);
    return ret += a;
  }
  mint operator-(const mint a) const {
    mint ret(*this);
    return ret -= a;
  }
  mint operator*(const mint a) const {
    mint ret(*this);
    return ret *= a;
  }
  mint pow(ll t) const {
    if(t==0) return mint(1);
    mint a = pow(t>>1);
    a *= a;
    if(t&1) a *= *this;
    return a;
  }
  
  //for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint ret(*this);
    return ret /= a;
  }
};
ostream &operator<<(ostream& os, const mint& x) {
  os << x.x;
  return os;
}
bool operator==(const mint& a, const mint& b){
  return a.x == b.x;
}



template<class T>
class LagrangeInterpolation {
  vector<pair<T,T>> v;
public:
  void add(const T& x, const T& y){
    v.emplace_back(x,y);
  }

  T calc(const T& x){
    T ret(0);
    for(int i=0; i<v.size(); i++){
      T t(1), u(1);
      for(int j=0; j<v.size(); j++){
        if(i==j) continue;
        t *= x - v[j].first;
        u *= v[i].first - v[j].first;
      }
      ret += t * v[i].second / u;
    }
    return ret;
  }

  vector<T> calc_coef(){
    vector<T> ret(v.size());

    vector<T> y(v.size());
    for(int i=0; i<v.size(); i++){
      T t(1);
      for(int j=0; j<v.size(); j++){
        if(i==j) continue;
        t *= v[i].first - v[j].first;
      }
      y[i] = v[i].second / t;
    }

    vector<vector<T>> dp(v.size()+1, vector<T>(v.size()+1));
    dp[0][0] = T(-1) * v[0].first;
    dp[0][1] = T(1);
    for(int i=1; i<v.size(); i++){
      for(int j=0; j<v.size()+1; j++){
        dp[i][j] = dp[i-1][j] * T(-1) * v[i].first;
        if(j>=1){
          dp[i][j] += dp[i-1][j-1];
        }
      }
    }

    vector<T> xinv(v.size());
    for(int i=0; i<v.size(); i++){
      xinv[i] = T(1) / T(v[i].first);
    }

    for(int i=0; i<v.size(); i++){
      if(y[i] == T(0)) continue;
      if(v[i].first == T(0)){
        for(int j=0; j<v.size(); j++){
          ret[j] += dp[v.size()-1][j+1] * y[i];
        }
      }else{
        ret[0] -= dp[v.size()-1][0] * xinv[i] * y[i];
        T t = T(-1) * dp[v.size()-1][0] * xinv[i];
        for(int j=0; j<v.size(); j++){
          ret[j] -= (dp[v.size()-1][j] - t) * xinv[i] * y[i];
          t = T(-1) * xinv[i] * (dp[v.size()-1][j] - t);
        }
      }
    }
    return ret;
  }
};





int main(){
  LagrangeInterpolation<mint> li;
  int N;
  cin >> N;
  mod = N;
  
  rep(i,N){
    int a;
    cin >> a;
    li.add(i,a);
  }

  vector<mint> res = li.calc_coef();
  rep(i,res.size()){
    cout << res[i] << endl;
  }

  return 0;
}


Measured memory_bytes: 73748