#include<bits/stdc++.h>
#define int long long
using namespace std;
namespace fast_IO {
#define IOSIZE 100000
char ibuf[IOSIZE], obuf[IOSIZE], *p1 = ibuf, *p2 = ibuf, *p3 = obuf;
#define getchar() ((p1==p2)and(p2=(p1=ibuf)+fread(ibuf,1,IOSIZE,stdin),p1==p2)?(EOF):(*p1++))
#define putchar(x) ((p3==obuf+IOSIZE)&&(fwrite(obuf,p3-obuf,1,stdout),p3=obuf),*p3++=x)
#define isdigit(ch) (ch>47&&ch<58)
#define isspace(ch) (ch<33)
template<typename T> inline T read() { T s = 0; int w = 1; char ch; while (ch = getchar(), !isdigit(ch) and (ch != EOF)) if (ch == '-') w = -1; if (ch == EOF) return false; while (isdigit(ch)) s = s * 10 + ch - 48, ch = getchar(); return s * w; }
template<typename T> inline bool read(T &s) { s = 0; int w = 1; char ch; while (ch = getchar(), !isdigit(ch) and (ch != EOF)) if (ch == '-') w = -1; if (ch == EOF) return false; while (isdigit(ch)) s = s * 10 + ch - 48, ch = getchar(); return s *= w, true; }
template<typename T> inline void print(T x) { if (x < 0) putchar('-'), x = -x; if (x > 9) print(x / 10); putchar(x % 10 + 48); }
inline bool read(char &s) { while (s = getchar(), isspace(s)); return true; }
inline bool read(char *s) { char ch; while (ch = getchar(), isspace(ch)); if (ch == EOF) return false; while (!isspace(ch)) *s++ = ch, ch = getchar(); *s = '\000'; return true; }
inline void print(char x) { putchar(x); }
inline void print(char *x) { while (*x) putchar(*x++); }
inline void print(const char *x) { for (int i = 0; x[i]; i++) putchar(x[i]); }
inline bool read(std::string& s) { s = ""; char ch; while (ch = getchar(), isspace(ch)); if (ch == EOF) return false; while (!isspace(ch)) s += ch, ch = getchar(); return true; }
inline void print(std::string x) { for (int i = 0, n = x.size(); i < n; i++) putchar(x[i]); }
inline bool read(bool &b) { char ch; while(ch=getchar(), isspace(ch)); b=ch^48; return true; }
inline void print(bool b) { putchar(b+48); }
template<typename T, typename... T1> inline int read(T& a, T1&... other) { return read(a) + read(other...); }
template<typename T, typename... T1> inline void print(T a, T1... other) { print(a), print(other...); }
struct Fast_IO { ~Fast_IO() { fwrite(obuf, p3 - obuf, 1, stdout); } } io;
template<typename T> Fast_IO& operator >> (Fast_IO &io, T &b) { return read(b), io; }
template<typename T> Fast_IO& operator << (Fast_IO &io, T b) { return print(b), io; }
#define cout io
#define cin io
}using namespace fast_IO;
const int mod=998244353,g=3;
int n,ig;
bool opt;
vector<int>a,b;
int qpow(int aa,int bb){
int res=1;
while(bb){
if(bb&1)res=res*aa%mod;
aa=aa*aa%mod;
bb>>=1;
}
return res;
}
vector<int>rev;
void ntt(int limit,vector<int> &a){
for(int i=0;i<limit;++i)if(i<rev[i])swap(a[i],a[rev[i]]);
for(int t=2;t<=limit;t<<=1){
int wn,w;
if(opt)wn=qpow(g,(mod-1)/t);
else wn=qpow(ig,(mod-1)/t);
for(int i=0;i<limit;i+=t){
w=1;
for(int j=i;j<i+(t>>1);++j){
int res=a[j];
a[j]=(res+w*a[j+(t>>1)]%mod)%mod;
a[j+(t>>1)]=((res-w*a[j+(t>>1)]%mod)%mod+mod)%mod;
w=w*wn%mod;
}
}
}
}
void dfs(vector<int> &b,vector<int> &a,int len){
if(len==1){
b[0]=qpow(a[0],mod-2);
return;
}
dfs(b,a,(len+1)>>1);
vector<int>c=a;
int limit=1;
while(limit<(n<<1))limit<<=1;
rev.resize(limit);
b.resize(limit);
c.resize(limit);
for(int i=0;i<limit;++i)rev[i]=((rev[i>>1]>>1)|((i&1)?(limit>>1):0));
opt=1;
ntt(limit,b);
ntt(limit,c);
for(int i=0;i<limit;++i)b[i]=(2*b[i]%mod-b[i]*b[i]%mod*c[i]%mod+mod)%mod;
opt=0;
ntt(limit,b);
b.resize(len);
int ilimit=qpow(limit,mod-2);
for(int i=0;i<limit;++i)b[i]=b[i]*ilimit%mod;
}
signed main(){
ig=qpow(g,mod-2);
cin>>n;
a.resize(n);
b.resize(n);
for(int i=0;i<n;++i)cin>>a[i];
dfs(b,a,n);
for(int i=0;i<n;++i)cout<<b[i]<<" ";
return 0;
}