N,K=list(map(int,input().split())) A=list(map(int,input().split())) MOD=998244353 P=A for i in range(K): for j in range(1,N): P[j]=(P[j-1]+P[j]*(-1)**(j%2))%MOD print(*P)