#include#define ri register intusing namespace std;inline int read(){ int ans=0; char ch=getchar(); while(!isdigit(ch))ch=getchar(); while(isdigit(ch))ans=(ans<<3)+(ans<<1)+(ch^48),ch=getchar(); return ans;}typedef long long ll;const int mod=998244353;int n,lim,tim;vector A,B,pos,Inv;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 int ksm(int a,int p){ int ret=1;for(;p;p>>=1,a=mul(a,a))if(p&1)ret=mul(ret,a);return ret;}inline void ntt(vector &a,int type){ for(ri i=0;i >=1){ wn=ksm(typ,mult); for(ri j=0,len=mid<<1;j >1]>>1)|((i&1)<<(tim-1));}struct poly{ vector a; inline int deg()const{ return a.size()-1;} poly(int k,int x=0){ a.resize(k+1),a[k]=x;} 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;} friend inline poly operator+(const poly&a,const poly&b){ poly ret(max(a.deg(),b.deg())); for(ri i=0;i<=a.deg();++i)ret[i]=add(ret[i],a[i]); for(ri i=0;i<=b.deg();++i)ret[i]=add(ret[i],b[i]); return ret; } friend inline poly operator-(const poly&a,const poly&b){ poly ret(max(a.deg(),b.deg())); for(ri i=0;i<=a.deg();++i)ret[i]=add(ret[i],a[i]); for(ri i=0;i<=b.deg();++i)ret[i]=dec(ret[i],b[i]); return ret; } friend inline poly operator*(const int&a,const poly&b){ poly ret(b.deg()); for(ri i=0;i<=b.deg();++i)ret[i]=mul(a,b[i]); return ret; } friend inline poly operator*(const poly&a,const poly&b){ int n=a.deg(),m=b.deg(); init(n+m),A.resize(lim),B.resize(lim); poly ret(lim-1); for(ri i=0;i<=n;++i)A[i]=a[i]; for(ri i=0;i<=m;++i)B[i]=b[i]; for(ri i=n+1;i >1); return (2*f0-((f0*f0.extend(k))*a).extend(k)).extend(k); } inline poly poly_direv(poly a){ poly ret(a.deg()-1); for(ri i=0;i<=ret.deg();++i)ret[i]=mul(a[i+1],i+1); return ret; } inline poly poly_inter(poly a){ poly ret(a.deg()+1); for(ri i=1;i<=ret.deg();++i)ret[i]=mul(Inv[i],a[i-1]); return ret; } inline poly poly_ln(poly a,int len){ poly ret=a.poly_direv(a); return ret=ret*a.poly_inv(a,len),ret.poly_inter(ret); } inline poly poly_exp(poly a,const int&k){ a=a.extend(k); if(k==1)return poly(0,1); poly f0=poly_exp(a,(k+1)>>1).extend(k); poly delt=a-poly_ln(f0,k); ++delt[0]; return (f0*delt).extend(k); }};int main(){ n=read()-1; poly ans(n); for(ri i=0;i<=n;++i)ans[i]=read(); int len=1; while(len<=n*2)len<<=1; Inv.resize(len),Inv[1]=1; for(ri i=2;i