class FPS: root=(1, 998244352, 911660635, 372528824, 929031873, 452798380, 922799308, 781712469, 476477967, 166035806, 258648936, 584193783, 63912897, 350007156, 666702199, 968855178, 629671588, 24514907, 996173970, 363395222, 565042129, 733596141, 267099868, 15311432) iroot=(1, 998244352, 86583718, 509520358, 337190230, 87557064, 609441965, 135236158, 304459705, 685443576, 381598368, 335559352, 129292727, 358024708, 814576206, 708402881, 283043518, 3707709, 121392023, 704923114, 950391366, 428961804, 382752275, 469870224) rate2=(911660635, 509520358, 369330050, 332049552, 983190778, 123842337, 238493703, 975955924, 603855026, 856644456, 131300601, 842657263, 730768835, 942482514, 806263778, 151565301, 510815449, 503497456, 743006876, 741047443, 56250497, 867605899, 0) irate2=(86583718, 372528824, 373294451, 645684063, 112220581, 692852209, 155456985, 797128860, 90816748, 860285882, 927414960, 354738543, 109331171, 293255632, 535113200, 308540755, 121186627, 608385704, 438932459, 359477183, 824071951, 103369235, 0) rate3=(372528824, 337190230, 454590761, 816400692, 578227951, 180142363, 83780245, 6597683, 70046822, 623238099, 183021267, 402682409, 631680428, 344509872, 689220186, 365017329, 774342554, 729444058, 102986190, 128751033, 395565204, 0) irate3=(509520358, 929031873, 170256584, 839780419, 282974284, 395914482, 444904435, 72135471, 638914820, 66769500, 771127074, 985925487, 262319669, 262341272, 625870173, 768022760, 859816005, 914661783, 430819711, 272774365, 530924681, 0) mod=998244353 Func=[0] def __init__(self,L): self.Func=[x%self.mod for x in L] def butterfly(self,a): n=len(a) h=(n-1).bit_length() LEN=0 while(LEN0 res=[pow(self.Func[0],self.mod-2,self.mod)] while(len(res)2*m: f=f[:2*m] if len(r)<2*m: r+=[0]*(2*m-len(r)) elif len(r)>2*m: r=r[:2*m] f=self.butterfly(f) r=self.butterfly(r) for i in range(2*m): f[i]*=r[i] f[i]%=self.mod f=self.butterfly_inv(f) f=f[m:] if len(f)<2*m: f+=[0]*(2*m-len(f)) elif len(f)>2*m: f=f[:2*m] f=self.butterfly(f) for i in range(2*m): f[i]*=r[i] f[i]%=self.mod f=self.butterfly_inv(f) iz=pow(2*m,self.mod-2,self.mod) iz*=-iz iz%=self.mod for i in range(m): f[i]*=iz f[i]%=self.mod res+=f[:m] return FPS(res[:d]) def __truediv__(self,other): if type(other)==int: invother=pow(other,self.mod-2,self.mod) ret=[(x*invother)%self.mod for x in self.Func] return FPS(ret) assert (other.Func[0]!=0) return self*(other.inv()) def __floordiv__(self,other): if not other: raise ZeroDivisionError if isinstance(other,int): return self/other self.reduce();other.reduce() F_deg=len(self.Func)-1 G_deg=len(other.Func)-1 if F_deg>d return self def __lt__(self,other): if len(self.Func)len(other.Func): return True else: return self.Funclen(other.Func): return True elif len(self.Func)other.Func def __eq__(self,other): return self.Func==other.Func def __le__(self,other): if len(self.Func)len(other.Func): return True else: return self.Func<=other.Func def __ge__(self,other): if len(self.Func)>len(other.Func): return True elif len(self.Func)other.Func def __ne__(self,other): return self.Func!=other.Func def __str__(self): return f'FPS({self.Func})' def diff(self): n=len(self.Func) ret=[0 for i in range(max(0,n-1))] for i in range(1,n): ret[i-1]=(self.Func[i]*i)%self.mod return FPS(ret) def integral(self): n=len(self.Func) ret=[0 for i in range(n+1)] for i in range(n): ret[i+1]=self.Func[i]*pow(i+1,self.mod-2,self.mod)%self.mod return FPS(ret) def log(self,deg=-1): assert self.Func[0]==1 n=len(self.Func) if deg==-1:deg=n return (self.diff()*self.inv()).integral() def mod_sqrt(self,a): p=self.mod assert 0<=a and a

>1,p)==1): b+=one m=p-1;e=0 while(m%2==0): m>>=1 e+=1 x=pow(a,(m-1)>>1,p) y=(a*x*x)%p x*=a; x%=p z=pow(b,m,p) while(y!=1): j=0 t=y while(t!=one): j+=1 t*=t t%=p z=pow(z,1<<(e-j-1),p) x*=z x%=p z*=z z%=p y*=z y%=p e=j return x def sqrt(self,deg=-1): n=len(self.Func) if deg==-1:deg=n if n==0:return FPS([0 for i in range(deg)]) if self.Func[0]==0: for i in range(1,n): if self.Func[i]!=0: if i&1:return FPS([]) if deg-i//2<=0:break ret=(self>>i).sqrt(deg-i//2) if len(ret.Func)==0:return FPS([]) ret=ret<<(i//2) if len(ret.Func)deg: return FPS(self.Func[:deg]) else: return self def exp(self,deg=-1): n=len(self.Func) assert n>0 and self.Func[0]==0 if deg==-1:deg=n assert deg>=0 g=[1] g_fft=[1,1] self.Func[0]=1 self.resize(deg) h_drv=self.diff() m=2 while(m2*m: t=t[:2*m] self.butterfly(t) g_fft=g[:] if len(g_fft)<2*m: g_fft+=[0]*(2*m-len(g_fft)) elif len(g_fft)>2*m: g_fft=g_fft[:2*m] self.butterfly(g_fft) for i in range(2*m): t[i]*=g_fft[i] t[i]%=self.mod self.butterfly_inv(t) tmp=pow(2*m,self.mod-2,self.mod) t=t[:m] for i in range(m): t[i]*=tmp t[i]%=self.mod else: g1=g[m//2:] s1=t[m//2:] t=t[:m//2] g1+=[0]*(m-len(g1)) s1+=[0]*(m-len(s1)) t+=[0]*(m-len(t)) self.butterfly(g1) self.butterfly(t) self.butterfly(s1) for i in range(m): s1[i]=(g_fft[i]*s1[i]+g1[i]*t[i])%self.mod for i in range(m): t[i]*=g_fft[i] t[i]%=self.mod self.butterfly_inv(t) self.butterfly_inv(s1) for i in range(m//2): t[i+m//2]+=s1[i] t[i+m//2]%=self.mod tmp=pow(m,self.mod-2,self.mod) for i in range(m): t[i]*=tmp t[i]%=self.mod #step 2.f v=self.Func[m:min(deg,2*m)]+[0]*(2*m-min(deg,2*m)) t=[0]*(m-1)+t t=FPS(t).integral().Func for i in range(m): v[i]-=t[m+i] v[i]%=self.mod #step 2.g if len(v)<2*m: v+=[0]*(2*m-len(v)) else: v=v[:2*m] self.butterfly(v) for i in range(2*m): v[i]*=f_fft[i] v[i]%=self.mod self.butterfly_inv(v) v=v[:m] tmp=pow(2*m,self.mod-2,self.mod) for i in range(m): v[i]*=tmp v[i]%=self.mod #step 2.h for i in range(min(deg-m,m)): self.Func[m+i]=v[i] m*=2 return self def powfps(self,k,deg=-1): a=self.Func[:] n=len(self.Func) if k==0: return FPS([int(i==0) for i in range(n)]) l=0 while(l=n: return FPS([0]*n) ic=pow(a[l],self.mod-2,self.mod) pc=pow(a[l],k,self.mod) a=FPS([(a[i]*ic)%self.mod for i in range(l,len(a))]).log() a*=k a=a.exp() a*=pc a=[0]*(l*k)+a.Func[:n-l*k] return FPS(a) N,K=map(int,input().split()) A=list(map(int,input().split())) v1=[0]*N v2=[0]*N for i in range(N): if i%2==0: v1[i//2]=A[i] else: v2[i//2]=A[i] t=(N+1)//2 mod=998244353 q1=[1]*t count=(K+1)//2 c=FPS(q1) d=c.powfps(count) e1=FPS(v1) e2=FPS(v2) p1=d*e1 p2=d*e2 ans1=p1.Func[:N] ans2=p2.Func[:N] result=[0]*N for i in range(N): if i%2==0: result[i]=ans1[i//2] else: result[i]=ans2[i//2] result[i]%=mod if K%2==1: r=[0]*N r[0]=result[0] for i in range(1,N): if i%2==1: r[i]=-result[i]+result[i-1] else: r[i]=result[i]-result[i-1] r[i]%=mod result=r[:] print(*result)