#include<bits/stdc++.h>

#define ri register int
using namespace std;
const int rlen=1<<18|1;
inline char gc()
{
    static char buf[rlen],*ib,*ob;
    (ib==ob)&&(ob=(ib=buf)+fread(buf,1,rlen,stdin));
    return ib==ob?-1:*ib++;
}
inline int read()
{
    int ans=0;
    char ch=gc();
    while(!isdigit(ch))
        ch=gc();
    while(isdigit(ch))
        ans=((ans<<2)+ans<<1)+(ch^48),ch=gc();
    return ans;
}
typedef long long ll;
int mod;
inline int add(const int&a,const int&b)
{
    return a+b>=mod?a+b-mod:a+b;
}
inline int dec(const int&a,const int&b)
{
    return a>=b?a-b:a-b+mod;
}
inline int mul(const int&a,const int&b)
{
    return (ll)a*b%mod;
}
inline void Add(int&a,const int&b)
{
    a=a+b>=mod?a+b-mod:a+b;
}
inline void Dec(int&a,const int&b)
{
    a=a>=b?a-b:a-b+mod;
}
inline void Mul(int&a,const int&b)
{
    a=(ll)a*b%mod;
}
inline int ksm(int a,int p)
{
    int ret=1;
    for(;p;p>>=1,a=mul(a,a))
        if(p&1)
            Mul(ret,a);
    return ret;
}
vector<int> pos[19],A,B,w[19];
int lim,tim,invv[19];
const int Lim=1<<19;

struct poly
{
    vector<int> a;
    poly(int k=0,int x=0)
    {
        a.resize(k+1),a[k]=x;
    }
    inline int deg() const
    {
        return a.size()-1;
    }
    inline int&operator[](const int&k)
    {
        return a[k];
    }
    inline const int&operator[](const int&k) const
    {
        return a[k];
    }
    inline poly extend(const int&k)
    {
        poly ret=*this;
        return ret.a.resize(k+1),ret;
    }
    inline poly rev()
    {
        return reverse(a.begin(),a.end()),*this;
    }
    inline int getval(const int&x)
    {
        int ret=0;
        for(ri i=0,mult=1,up=deg();i<=up;++i,Mul(mult,x))
            Add(ret,mul(mult,a[i]));
        return ret;
    }
};

inline poly operator+(const poly&a,const poly&b)
{
    int n=a.deg(),m=b.deg();
    poly ret(max(n,m));
    for(ri i=0;i<=n;++i)
        Add(ret[i],a[i]);
    for(ri i=0;i<=m;++i)
        Add(ret[i],b[i]);
    return ret;
}
inline poly operator-(const poly&a,const poly&b)
{
    int n=a.deg(),m=b.deg();
    poly ret(max(n,m));
    for(ri i=0;i<=n;++i)
        Add(ret[i],a[i]);
    for(ri i=0;i<=m;++i)
        Dec(ret[i],b[i]);
    return ret;
}
inline poly operator*(const int&a,const poly&b)
{
    poly ret=b;
    for(ri i=0,n=ret.deg();i<=n;++i)
        Mul(ret[i],a);
    return ret;
}
inline poly poly_direv(const poly&a)
{
    poly ret(a.deg()-1);
    for(ri i=1,up=a.deg();i<=up;++i)
        ret[i-1]=mul(a[i],i);
    return ret;
}
inline poly operator*(poly a,poly b)
{
    int n=a.deg(),m=b.deg(),t=n+m;
    poly c(t);
    for(ri i=0;i<=n;++i)
        for(ri j=0;j<=m;++j)
            Add(c[i+j],mul(a[i],b[j]));
    return c;
}
inline poly operator%(poly a,poly b)
{
    int n=a.deg(),m=b.deg();
    if(n<m)
        return a;
    for(ri t,i=n;i>=m;--i)
    {
        t=a[i];
        for(ri j=i,tt=m;~tt;--tt,--j)
            Dec(a[j],mul(b[tt],t));
    }
    return a=a.extend(m),a;
}
const int N=1e5+5;
#define lc (p<<1)
#define rc (p<<1|1)
#define mid (l+r>>1)
poly T[N<<2];
int n,fx[N],fy[N],val[N];
inline void build(int p,int l,int r)
{
    if(l==r)
    {
        T[p]=poly(1,1),T[p][0]=mod-fx[l];
        return;
    }
    build(lc,l,mid),build(rc,mid+1,r);
    T[p]=T[lc]*T[rc];
}
inline void getval(int p,int l,int r,poly t)
{
    if(l==r)
    {
        val[l]=mul(ksm(t.getval(fx[l]),mod-2),fy[l]);
        return;
    }
    getval(lc,l,mid,t%T[lc]),getval(rc,mid+1,r,t%T[rc]);
}
inline poly dc_ntt(int p,int l,int r)
{
    if(l==r)
        return poly(0,val[l]);
    poly L=dc_ntt(lc,l,mid),R=dc_ntt(rc,mid+1,r);
    return L*T[rc]+T[lc]*R;
}
#undef lc
#undef rc
#undef mid
int main()
{
    mod=n=read();
    for(ri i=1;i<=n;++i)
        fx[i]=i-1,fy[i]=read();
    build(1,1,n);
    getval(1,1,n,poly_direv(T[1]));
    poly f=dc_ntt(1,1,n);
    for(ri i=0;i<n;++i)
        cout<<f[i]<<' ';
    return 0;
}



Measured memory_bytes: 22400