#include <bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

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

int getRand(int l, int r)
{
    uniform_int_distribution<int> uid(l, r);
    return uid(rng);
}
  
#define int long long 
#define pb push_back
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vi vector<int>
#define pii pair<int,int>
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define precise(x) fixed << setprecision(x) 

const int MOD = 998244353;

int mod_pow(int a,int b,int M = MOD)
{
    int res = 1;
    
    while(b)
    {
        if(b&1) res=(res*a)%M;
        a=(a*a)%M;
        b>>=1;
    }
    
    return res;
}

const int N = 310;
int ncr[N][N];
int table[N][N];
int psum[N];

const int M = 2e5 + 10;
int b[M];

void solve()
{
   for(int i=0;i<N;i++)
   {
       ncr[i][0] = 1;
       
       for(int j=1;j<=i;j++)
       {
           ncr[i][j] = (ncr[i-1][j] + ncr[i-1][j-1])%MOD;
       }
   }
    
   int n,k;
   cin >> n >> k;
    
   int a[n];
    f(i,n) cin >> a[i];
    
   f(i,n) b[i] = a[i];
    
   for(int i=1;i<=k;i++)
   {
       f(j,n) psum[i] = (psum[i] + b[j])%MOD;
       f(j,n) b[j] = (b[j]*a[j])%MOD;
   }
    
   f(i,n) b[i] = a[i];
    
   for(int i=1;i<=k;i++)
   {
       for(int j=1;j<=k;j++)
       {
           if(i + j <= k)
           {
           table[i][j] = (psum[i]*psum[j])%MOD;
           table[i][j] -= psum[i+j];
           table[i][j]%=MOD;
               
           if(i == j) table[i][j] = (table[i][j]*mod_pow(2,MOD-2))%MOD;   
               
           if(table[i][j] < 0) table[i][j]+=MOD;
           }
       }
   }
    
   for(int i=1;i<=k;i++)
   {
       int res = 0;
       
       res+=(n-1)*psum[i];
       res%=MOD;
       
       for(int j=1;j<=i/2;j++)
       {
           int temp = ncr[i][j];
           temp = (temp*table[j][i-j])%MOD;
           
           res+=temp;
           res%=MOD;
       }
       
       cout << res << '\n';
   }
    
}

signed main()
{
    fast;
    
    int t = 1;
    
//    cin >> t;
    
    while(t--)
        
    solve();
}
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define p 998244353

int MOD(int a){
	return (a %= p) >= 0 ? a : a + p;
}

int power(int a, int N){
	if(N == 0) return 1;
	else if(N % 2 == 0) return power(MOD(a * a), N / 2);
	else return MOD(a * power(a, N - 1));
}

int inverse(int a){
	return power(a, p - 2);
}

int fact(int N){
	static vector<int> _fact(1, 1);
	for(int i = _fact.size(); i <= N; i++){
		_fact.push_back(MOD(i * _fact[i - 1]));
	}
	return _fact[N];
}
 
int fact_inv(int N){
	static vector<int> inv(2, 1), _fact_inv(2, 1);
	for(int i = inv.size(); i <= N; i++){
		inv.push_back(MOD(-(p / i) * inv[p % i]));
		_fact_inv.push_back(MOD(inv[i] * _fact_inv[i - 1]));
	}
	return _fact_inv[N];
}
 
int combination(int N, int k){
	if(k < 0 || N < k || N < 0) return 0;
	else return MOD(fact(N) * MOD(fact_inv(N - k) * fact_inv(k)));
}

signed main(){
	int N, K, i, j;
	scanf("%lld%lld", &N, &K);
	vector<int> A(N);
	for(i = 0; i < N; i++){
		scanf("%lld", &A[i]);
	}
	vector<int> S(K + 1, 0);
	for(i = 0; i < N; i++){
		int a = 1;
		for(j = 0; j <= K; j++){
			S[j] = MOD(S[j] + a);
			a = MOD(a * A[i]);
		}
	}
	for(i = 1; i <= K; i++){
		int sub = 0;
		for(j = 0; j <= i; j++){
			sub = MOD(sub + combination(i, j) * MOD(S[i - j] * S[j]));
		}
		int ans = MOD(MOD(sub - power(2, i) * S[i]) * inverse(2));
		printf("%lld\n", ans);
	}
	return 0;
}