// #define DEBUGGING
#include <bits/stdc++.h>
#define endl '\n'
#define ALL(v) std::begin(v), std::end(v)
#define ALLR(v) std::rbegin(v), std::rend(v)
using ll = std::int64_t;
using ull = std::uint64_t;
using pll = std::pair<ll, ll>;
using tll = std::tuple<ll, ll, ll>;
template <typename T> using vec = std::vector<T>;
template <typename T> using vvec = vec<vec<T>>;
template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename T, typename... Tail> const T& var_min(const T &t, const Tail&... tail) { return std::min(t, var_min(tail...)); }
template <typename T, typename... Tail> const T& var_max(const T &t, const Tail&... tail) { return std::max(t, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
template <typename T> const T& clamp(const T &t, const T &low, const T &high) { return std::max(low, std::min(high, t)); }
template <typename T> void chclamp(T &t, const T &low, const T &high) { return t = clamp(t, low, high); }
namespace init__ { struct InitIO { InitIO() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(30); } } init_io; }
#define mv_rec make_v(init, tail...)
template <typename T> T make_v(T init) { return init; }
template <typename T, typename... Tail> auto make_v(T init, size_t s, Tail... tail) { return vec<decltype(mv_rec)>(s, mv_rec); }
#undef mv_rec

#ifdef DEBUGGING
#else
#define DEBUG(...) 0
#define DEBUG_SEPARATOR_LINE 0
#endif

class Combination {
    vec<ll> factv, ifactv;

public:
    const ll mod;

    Combination(ll mod) : factv(mod), ifactv(mod), mod(mod) {
        factv[0] = 1;
        for (ll i = 1; i < mod; i++) factv[i] = factv[i - 1] * i % mod;
        ifactv.back() = inv(factv.back());
        for (ll i = (ll)factv.size() - 2; 0 <= i; i--) ifactv[i] = ifactv[i + 1] * (i + 1) % mod;
    }

    ll pow(ll n, ll k) {
        ll ret = 1, cur = n;
        while (k) {
            if (k & 1) (ret *= cur) %= mod;
            cur = cur * cur % mod;
            k /= 2;
        }
        return ret;
    }

    ll inv(ll n) { return pow(n, mod - 2); }

    ll fact(ll n) const {
        return factv[n]; 
    }

    ll ifact(ll n) const {
        return ifactv[n];
    }

    ll perm(ll n, ll k) const {
        return factv[n] * ifactv[n - k] % mod;
    }

    ll comb(ll n, ll k) const {
        return perm(n, k) * ifactv[k] % mod;
    }
};

using namespace std;

int main() {
    ll mod;
    cin >> mod;
    Combination c(mod);
    vec<ll> a(mod);
    for (ll &e : a) cin >> e;
    vec<ll> ans(mod);
    auto table = make_v<ll>(0, mod, mod);
    for (ll i = 1; i < mod; i++) {
        table[i][0] = 1;
        for (ll j = 1; j < mod; j++) table[i][j] = table[i][j - 1] * i % mod;
    }
    table[0][0] = 1;
    for (ll i = 0; i < mod; i++) {
        if (!a[i]) continue;
        ll mns = (mod - i) % mod;
        for (ll j = 0; j < mod; j++) {
            ll coff = mod - c.comb(mod - 1, j) * table[mns][mod - 1 - j] % mod;
            ans[j] += coff % mod;
        }
        ans[0]++;
    }
    for (ll i = 0; i < mod; i++) cout << ans[i] % mod << " \n"[i + 1 == mod];
    return 0;
}


Measured memory_bytes: 70784