#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const ll mo = 998244353;
const int MAX = 510000;
const int MOD = 998244353;
long long fac[MAX], finv[MAX], inv[MAX];
ll mypow(ll a, ll b){
  ll res = 1;
  a %= mo;
  while (b)
  {
    if (b & 1)
      res = res * a % mo;
    a = a * a % mo;
    b >>= 1;
  }
  return res;
}
void COMinit(){
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++)
  {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}
long long COM(int n, int k){
  if (n < k)
    return 0;
  if (n < 0 || k < 0)
    return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main()
{
ll k , n ;
cin >> k >> n ;
vector<ll> ans(2*k-1);
COMinit();
for (ll i = 2; i <= 2*k; i++)
{
  ll kk;
  if(i<k+1)kk=i-1;
  else kk=2*k+1-i;
  if(i%2){
    rep(j,kk/2+1){
      ll te=COM(kk/2,j)*mypow(2,j);
      te%=mo;
      te*=COM(n-j+j+k-kk-1,j+k-kk-1);
      te%=mo;
      ans[i-2]+=te;
      ans[i-2]%=mo;
    }
  }
  else{
    rep(j,kk/2+1){
      ll te=COM(kk/2,j)*mypow(2,j);
      te%=mo;
      te*=COM(n-j+j+k-kk-1,j+k-kk-1);
      te%=mo;
      ans[i-2]+=te;
      ans[i-2]%=mo;
    }
    rep(j,kk/2+1){
      ll te=COM(kk/2,j)*mypow(2,j);
      te%=mo;
      te*=COM(n-j+j+k-kk-1-1,j+k-kk-1);
      te%=mo;
      ans[i-2]+=te;
      ans[i-2]%=mo;
    }
  }
}

for(auto a:ans){
  cout << a << endl;
  
}
return 0;
}
//Be Name Khoda, Besmellah Rahmane Rahim, In The Name Of God;
//#include<bits/stdc++.h>
#include<iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <queue>
#include <deque>
#include <map>
#include <stack>
#include<bitset>
#include<list>
#include<cassert>
#include<numeric>
#include <stdio.h>
#include <string.h>
#include<iomanip>
#include<unordered_map>
#include<unordered_set>

using namespace std;

const long long N = 2e3 + 5;
const long long mod = 1e9 + 7;
long long dp[N][N];
long long fact[N * N];
long long n, k;
//dp[i][j] = the number of ways when i zero has come and j colorful ball has come


void pre()
{
	fact[0] = 1;
	for (long long i = 1; i < N * N; i++)
	{
		fact[i] = fact[i - 1] * i;
		fact[i] = fact[i] % mod;
	}
}

long long power(long long a, long long b)
{
	if (!b)
	{
		return 1;
	}
	long long ans = power(a, b / 2);
	ans = ans * ans;
	ans = ans % mod;
	if (b % 2)
	{
		ans = ans * a;
		ans = ans % mod;
	}
	return ans % mod;
}

long long choose(long long a, long long b)
{
	if (a > b)
	{
		return 0;
	}
	long long ans = fact[b];
	ans = ans * power(fact[a], mod - 2);
	ans = ans % mod;
	ans = ans * power(fact[b - a], mod - 2);
	ans = ans % mod;
	return ans;
}


int main()
{
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	pre();
	cin >> n >> k;
	dp[0][0] = 1;
	for (int i = 0; i <= n; i++)
	{
		for (int j = 0; j <= n; j++)
		{
			// the i + j * (k - 1) + 1th ball 
			if (j > i)
			{
				continue;
			}
			if (i == j) // this ball only can be zero
			{
				dp[i + 1][j] += dp[i][j];
				dp[i + 1][j] %= mod;
				continue;
			}
			else
			{
				//this ball is zero
				dp[i + 1][j] += dp[i][j];
				dp[i + 1][j] %= mod;
				// this ball is colorful
				dp[i][j + 1] += dp[i][j] * choose(k - 2, n * k - i - j * (k - 1) - 1);
				dp[i][j + 1] %= mod;
			}
		}
	}
	if (k > 1)
	{
		cout << (dp[n][n] * fact[n]) % mod << endl;
	}
	else
	{
		cout << 1 << endl;
	}

}


