#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
using namespace std;

using vi = vector<int>;

vi pf(int x) {
    vi r;
    for (int i = 2; i * i <= x; i++) {
        if (x % i == 0) {
            r.push_back(i);
            while (x % i == 0) {
                x /= i;
            }
        }
    }
    if (x > 1) {
        r.push_back(x);
    }
    return r;
}

long long f(vi const& a) {
    if (a.empty())
        return 1;
    long  long r = 9e18;
    for (int p : pf(a.front())) {
        vi b;
        copy_if(begin(a), end(a), back_inserter(b), [p](int x) { return x % p; });
        r = min(r, p * f(b));
    }
    return r;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;
    vi a(n);
    for (int& x : a) {
        cin >> x;
    }
    cout << f(a) << '\n';
    return 0;
}

#include <bits/stdc++.h>
// #include <atcoder/all>
// #include "icld.cpp"
using namespace std;
using ll = long long int;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using ss = string;
using db = double;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
#define V vector
#define P pair<int,int>
#define rep(i,s,n) for(int i=(s);i<(int)(n);i++)
#define rev(i,s,n) for(int i=(s);i>=(int)(n);i--)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define ci(x) cin >> x
#define cii(x) int x;cin >> x
#define cci(x,y) int x,y;cin >> x >> y
#define co(x) cout << x << endl
template<class T>void chmax(T &x,T y){x=max(x,y);}
template<class T>void chmin(T &x,T y){x=min(x,y);}

ll mod=998244353;
int ma=310;
ll f(ll x,ll n){
  if(n==0)return 1;
  if(n==1)return x;
  if(n%2)return x*f(x,n-1)%mod;
  ll res=f(x,n/2);
  return res*res%mod;
}

vll fac(ma,1),inv(ma,1),vac(ma,1);
void ready(){
  rep(i,2,ma){
    fac[i]=fac[i-1]*i%mod;
    inv[i]=mod-inv[mod%i]*(mod/i)%mod;
    vac[i]=vac[i-1]*inv[i]%mod;
  }
}
ll nck(ll n,ll k){
  if(n<k || n<0||k<0)return 0;
  return fac[n]*vac[n-k]%mod*vac[k]%mod;
}

int main(){
  cci(n,k);
  vi v(n);
  k++;
  rep(i,0,n)ci(v[i]);

  vll All(k+1,n);
  V<vll> num(k+1,vll(n,1));

  rep(x,1,k+1){
    ll now=0;
    rep(i,0,n)(now+=num[x][i]=num[x-1][i]*v[i]%mod)%=mod;
    All[x]=now;
  } 

ready();

  rep(x,1,k){
    ll ans=(mod+n-f(2,x-1))*All[x]%mod;
    ll now=0;
    rep(i,1,x){
      now+=nck(x,i)*All[i]%mod*All[x-i]%mod;
      now%=mod;
    }
    ans+=now*inv[2]%mod;
    
    co(ans%mod);
  }
}