#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <chrono>
#include <random>
#include <functional>

using namespace std;

const int N = 2e5 + 8;
const int K = 301;
const int MOD = 998244353;

int add(int a, int b) {
    if (a + b < MOD) {
        return a + b;
    }
    return a + b - MOD;
}

int sub(int a, int b) {
    if (a >= b) {
        return a - b;
    }
    return a - b + MOD;
}

int mul(int a, int b) {
    return 1LL * a * b % MOD;
}

int binpow(int a, int b) {
    int res = 1;
    while (b) {
        if (b & 1) res = mul(res, a);
        a = mul(a, a);
        b /= 2;
    }
    return res;
}

int divv(int a, int b) {
    return mul(a, binpow(b, MOD - 2));
}

int a[N];
int s[K];
int ans[K];
int C[K][K];

void init() {
    for (int i = 0; i < K; i++) {
        C[i][0] = 1;
        for (int j = 1; j <= i; j++) {
            C[i][j] = add(C[i - 1][j], C[i - 1][j - 1]);
        }
    }
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    init();

    int n, k;
    cin >> n >> k;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    for (int i = 0; i < n; i++) {
        int c = 1;
        for (int j = 0; j < K; j++) {
            s[j] = add(s[j], c);
            c = mul(c, a[i]);
        }
    }
    for (int i = 0; i < K; i++) {
        for (int j = 0; i + j < K; j++) {
            int S = mul(s[i], s[j]);
            S = sub(S, s[i + j]);
            S = divv(S, 2);
            ans[i + j] = add(ans[i + j], mul(C[i + j][j], S));
        }
    }
    for (int i = 1; i <= k; i++) {
        cout << ans[i] << '\n';
    }
}

#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pb emplace_back 
#define mp make_pair
#define fi first 
#define se second 
#define all(v) v.begin(),v.end()
#define run ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);cerr.tie(0);
#define mod 1000000007
#define decimal(n,k) cout<<fixed<<setprecision(k)<<n<<endl 
#define LL_MAX LLONG_MAX 
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
int exp(int x,int y){int res=1;x=x%mod;while(y>0){if(y&1)res=(res*x)%mod;y=y>>1;x=(x*x)%mod;}return res;}
int modinv(int x){return exp(x,mod-2);}
int add(int a,int b){a%=mod,b%=mod;a=((a+b)%mod+mod)%mod;return a;}
int sub(int a,int b){a%=mod,b%=mod;a=((a-b)%mod+mod)%mod;return a;}
int mul(int a,int b){a%=mod,b%=mod;a=((a*b)%mod+mod)%mod;return a;}
int gcd(int a, int b){if (b == 0)return a; return gcd(b, a % b);}
int log2n( int n){ return (n > 1) ? 1 + log2n(n / 2) : 0;} 
int fac[1000009];int ncr_mod(int n,int k){int ans=fac[n];ans*=modinv(fac[k]);ans%=mod;ans*=modinv(fac[n-k]);ans%=mod;return ans;}
vector<int>v_prime;void Sieve(int n){bool prime[n + 1];memset(prime,true,sizeof(prime));for (int p = 2; p*p <=n;p++){if(prime[p] ==true) {for(int i = p*p; i<= n; i += p)prime[i]=false;}}for(int p = 2;p<= n;p++)if (prime[p])v_prime.pb(p);}
vector<int>v_factor;void factor(int n){ for (int i=1; i<=sqrt(n); i++) {if (n%i == 0) {if (n/i == i) v_factor.pb(i);else { v_factor.pb(i),v_factor.pb(n/i);};} } sort(all(v_factor)); } 
void out(vector<int>&a){for(int i=0;i<a.size();i++) cout<<a[i]<<" "; } 
void sout(set<int>s){for(auto it=s.begin();it!=s.end();++it)cout<<*it<<" ";  cout<<endl;}  
void mout(map<int,int>mm){for(auto it=mm.begin();it!=mm.end();++it) cout<<it->fi<<" "<<it->se<<endl;}
int power(int x, int y){int temp;if( y == 0)return 1; temp = power(x, y / 2);if (y % 2 == 0) return temp * temp;else return x * temp * temp;}
 
 
// s.top().second;
 
 
signed main()
{
 
 
      run;
 
 
/* 
open for mod factorial
 
     fac[0]=1;
      for(int i=1;i<1000009;i++)
      {
          fac[i]=mul(fac[i-1],i); 
           
      }
*/
 
 
/*
  for sieve open this and use v_prime 
 
          int pp=pow(10,6)+100000;
               Sieve(pp);
*/
 
 
 //   factor(n)  &&   USE v_factor For calculating factors 
 
 
int  t=1;
//cin>>t;
while(t--)
{
             //  map<int,int>mp; // x.second-->frequency
 
 
             int  n,i,x,y,ok=0,sum=0,ans=0,j,k,cnt=0,m,c=0;
             int  h[100009]={0};
 
 
                  cin>>x>>y;
 
 
 
 
            vector<int>a(y,0),v,b(x,0);
           int  x1=-power(10,6);
 
            for(i=0;i<y;i++)
              {
                  a[i]=x1;
                  x1++;
                  sum+=a[i];

              }


              for(i=0;i<x-1;i++)
              {
                  b[i]=i+1;
                  sum+=b[i];
              }
             
              b[x-1]=abs(sum);
              out(a);
              
              out(b);

              




 
 
}
}