N,M=map(int,input().split()) A=list(map(int,input().split())) ans=[1]*N mod=998244353 ans = [x * y for (x, y) in zip(A, ans)] R=list() R.append(sum(ans)%mod) L=list() for i in range(M-1): ans = [x%mod * y%mod for (x, y) in zip(A, ans)] R.append(sum(ans)%mod) print(" ".join(map(str,R)))