//#pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl")
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
#define LL long long
#define VE vector
#define VI vector<int>
#define FOR(i,a,n) for(i=a;i<n;++i)
#define rep(i,n) FOR(i,0,n)
#define MOD 998244353
#define coutl cout<<fixed<<setprecision(15)
#define FAST cin.tie(0);ios::sync_with_stdio(false)

#define MI modint<MOD>
template<int mod>struct modint{
	int x;
	modint():x(0){}
	modint(LL n):x(n>=0?n%mod:(mod-(-n)%mod)%mod){}
	modint &operator+=(const modint &n){if((x+=n.x)>=mod)x-=mod;return *this;}
	modint &operator-=(const modint &n){if((x+=mod-n.x)>=mod)x-=mod;return *this;}
	modint &operator++(){*this+=1;return *this;}
  modint &operator--(){*this-=1;return *this;}
	modint &operator*=(const modint &n){x=(int)((LL)x*n.x%mod);return *this;}
	modint &operator/=(const modint &n){*this*=n.inv();return *this;}
	modint operator-()const{return modint(-x);}
	modint operator+(const modint &n)const{return modint(*this)+=n;}
	modint operator-(const modint &n)const{return modint(*this)-=n;}
	modint operator++(int){modint ret(*this);*this+=1;return ret;}
  modint operator--(int){modint ret(*this);*this-=1;return ret;}
	modint operator*(const modint &n)const{return modint(*this)*=n;}
	modint operator/(const modint &n)const{return modint(*this)/=n;}
	bool operator<(const modint &n)const{return x<n.x;}
	bool operator>(const modint &n)const{return x>n.x;}
	bool operator<=(const modint &n)const{return x<=n.x;}
	bool operator>=(const modint &n)const{return x>=n.x;}
	bool operator!=(const modint &n)const{return x!=n.x;}
	bool operator==(const modint &n)const{return x==n.x;}
	friend istream &operator>>(istream &is,modint &n){LL l;is>>l;n=modint<mod>(l);return is;}
	friend ostream &operator<<(ostream &os,const modint &n){return os<<n.x;}
	int getmod(){return mod;}
	modint inv()const{int a=x,b=mod,c=1,d=0,n;while(b){n=a/b;swap(a-=n*b,b);swap(c-=n*d,d);}return modint(c);}
	modint pow(LL n)const{modint ret(1),m(x);while(n){if(n&1)ret*=m;m*=m;n>>=1;}return ret;}
};

int main(){
  FAST;
  int i,j,N,K;
  cin>>N>>K;
  VI A(N);
  rep(i,N)cin>>A[i];
  MI k,ans;
  VE<MI> v(K+1),p(K+1),q(K+1),a(K+1);
  p[0]=q[0]=1;
  FOR(i,1,K+1)p[i]=p[i-1]*i,q[i]=q[i-1]/i;
  v[0]=N;
  rep(j,N){
    k=A[j];
    FOR(i,1,K+1){
      v[i]+=k*q[i];
			a[i]+=k;
      k*=A[j];
    }
  }
  FOR(i,1,K+1){
    ans=0;
    rep(j,i+1)ans+=v[j]*v[i-j];
    ans*=p[i];
    k=a[i];
    rep(j,i)k*=2;
    ans=(ans-k)/2;
    cout<<ans<<endl;
  }
}

/*
#pragma GCC optimize("O2")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,fma")
//*/
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int  ,int > pii;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const ll maxn  = 3e6;
const ll mod =998244353;
const ld PI = acos((ld)-1);

#define pb push_back
#define endl '\n'
#define dokme(x) cout << x , exit(0)
#define migmig ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define ms(x , y) memset(x , y , sizeof x)
ll pw(ll a, ll b, ll md = mod){ll res = 1;while(b){if(b&1){res=(a*res)%md;}a=(a*a)%md;b>>=1;}return(res);}

ll fact[maxn];

ll inv[maxn];

ll n , k;

ll a[maxn];

ll sum[maxn];

int32_t main(){
    migmig;
	cin >> n >> ::k;
	fact[0] = inv[0] = 1;
	for(int i = 1 ; i <= ::k ; i ++)
		fact[i] = (fact[i - 1] * i)%mod , inv[i] = pw(fact[i] , mod - 2);
	for(int i = 1 ; i <= n ; i ++)
		cin >> a[i];
	for(int i = 0 ; i <= ::k ; i ++)
		for(int j = 1 ; j <= n ; j ++)
			sum[i] = (sum[i] + pw(a[j] , i))%mod;
	for(int x = 1 ; x <= ::k ; x ++){
		ll ans = 0;
		for(int k = 0 ; k <= x ; k ++){
			ll res = (sum[k] * sum[x - k])%mod;
			res = (res * inv[k])%mod;
			res = (res * inv[x - k])%mod;
			ans = (ans + res)%mod;
		}
		ans = (ans * fact[x])%mod;
		for(int i = 1 ; i <= n ; i ++)
			ans = (ans - pw(a[i]*2 , x) + mod)%mod;
		cout << (ans*pw(2 , mod - 2))%mod << endl;
	}
    return(0);
}
