n,k = map(int,input().split()) a = list(map(int,input().split())) aa = a[:] c = [a[:]] import itertools for i in range(10): b = [a[j] if j % 2 == 0 else -a[j] for j in range(n)] a = list(itertools.accumulate(b)) c.append(a) #print(*a) a = aa[:] mod = 998244353 ans = [] for i in range(n): if 0: x = c[1][i] - c[0][i] y = c[3][i] - c[2][i] cnt = (k//2) + (k % 2) d = y-x res = x * cnt + d * ((1+cnt-1)*(cnt-1)//2) x = c[2][i] - c[1][i] y = c[4][i] - c[3][i] cnt = (k//2) d = abs(y-x) print(i,x,y,d,cnt) res += (x * cnt + d * ((1+cnt-1)*(cnt-1)//2) + a[i]) % mod ans.append(res%mod) else: x = c[1][i] - c[0][i] y = c[3][i] - c[2][i] cnt = (k//2) + (k % 2) d = -abs(y-x) res = x * cnt + d * ((1+cnt-1)*(cnt-1)//2) x = c[2][i] - c[1][i] y = c[4][i] - c[3][i] cnt = (k//2) d = abs(y-x) res += (x * cnt + d * ((1+cnt-1)*(cnt-1)//2) + a[i]) % mod ans.append(res%mod) print(*ans) -20 20 -20 20 -6 8 -9 11 -12 14 -2 6 -3 8 -4 10 -5 12 -6