Takahashi throws N dice, each having K sides with all integers from 1 to K. The dice are NOT pairwise distinguishable.
For each i=2,3,...,2K, find the following value modulo 998244353:
 - The number of combinations of N sides shown by the dice such that the sum of no two different sides is i.
Note that the dice are NOT distinguishable, that is, two combinations are considered different when there exists an integer k such that the number of dice showing k is different in those two.

-----Constraints-----
 - 1 \leq K \leq 2000
 - 2 \leq N \leq 2000
 - K and N are integers.

-----Input-----
Input is given from Standard Input in the following format:
K N

-----Output-----
Print 2K-1 integers. The t-th of them (1\leq t\leq 2K-1) should be the answer for i=t+1.

-----Sample Input-----
3 3

-----Sample Output-----
7
7
4
7
7

 - For i=2, the combinations (1,2,2),(1,2,3),(1,3,3),(2,2,2),(2,2,3),(2,3,3),(3,3,3) satisfy the condition, so the answer is 7.
 - For i=3, the combinations (1,1,1),(1,1,3),(1,3,3),(2,2,2),(2,2,3),(2,3,3),(3,3,3) satisfy the condition, so the answer is 7.
 - For i=4, the combinations (1,1,1),(1,1,2),(2,3,3),(3,3,3) satisfy the condition, so the answer is 4.

Difficulty: competition

Starter code:

Solutions:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 998244353
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

K,N = inpl()
MAX = K+N+10
fac = [1]*(MAX+1)
for i in range(1,MAX+1):
	fac[i] = (fac[i-1]*i)%mod

gyakugen = [1]*(MAX+1)
gyakugen[MAX] = pow(fac[MAX],mod-2,mod)
for i in range(MAX,0,-1):
	gyakugen[i-1] = (gyakugen[i]*i)%mod

def Comb(n,k):#nCk
	return (fac[n]*gyakugen[k]*gyakugen[n-k])%mod

#K=k,N=n,0pair = 0
def calc(k,n,i):
	#i=2に帰着させる
	pairs = (i-2)//2
	k -= pairs
	n -= pairs

	#色々と例外処理
	if n < 0 or k <= 0:
		return 0
	elif k == 1 and n >= 2:
		return 0

	if n == 0: 	 #球が0個なら1通り
		ans = 1
	else:
		ans = 0
		#i=2の時の数え上げ
		for x in range(2):
			ball = n-x	#球
			box = k-1	#箱
			ans += Comb(box-1+ball,ball)%mod

	ans *= pow(2,pairs,mod)	#0pairの選び方
	return ans % mod

ans = []
for i in range(2,K+2):
	if i%2 == 0:
		pairs = (i-2)//2
		tmp = 0
		for p0 in range(pairs+1): #p0 = 0pairの数
			tmp1 = calc(K-p0*2 , N , i-p0*2) %mod #k-p0*2,i-p0*2で0pairが0組
			tmp2 = Comb(pairs,p0) %mod #0pairの選び方
			tmp += tmp1 * tmp2
			tmp %= mod
	ans.append(tmp)
	print(tmp)

ans = ans[::-1]
for i in range(1,K):
	print((ans[i]))


import sys
input = sys.stdin.readline

# K+1 - x でうつす -> i と 2K+2-i は同じ

MOD = 998244353
U = 10000
fact = [1] * (U+1)
fact_inv = [1] * (U+1)
for n in range(1,U+1):
    fact[n] = fact[n-1] * n % MOD
fact_inv[n] = pow(fact[n], MOD-2, MOD)
for n in range(U,0,-1):
    fact_inv[n-1] = fact_inv[n] * n % MOD

def comb(n,k):
    if not (0 <= k <= n):
        return 0
    return fact[n] * fact_inv[k] * fact_inv[n-k] % MOD

K,N = list(map(int,input().split()))

def F(x,y,N):
    n = min(x, N)
    return sum(comb(x,i) * pow(2,i,MOD) * comb(N+y-1,i+y-1) % MOD for i in range(n+1)) % MOD

answer = []
for S in range(3,K+3,2):
    x = F((S-1)//2, K - S + 1, N)
    answer.append(x)
    answer.append(x)

if K & 1:
    answer = answer[:-1]
    answer += answer[:-1][::-1]
else:
    answer += answer[:-1][::-1]    

print(('\n'.join(map(str,answer))))



def mul(c,m,dp): #multiply (1+x^c) up to x^m
    for i in range(m,c-1,-1):
        dp[i] += dp[i-c]
        dp[i] %= MOD

def mul2(c,m,dp): #multiply (1+x^c) up to x^m
    for i in range(m,c-1,-1):
        dp[i] -= dp[i-c]
        dp[i] %= MOD
 
def div(c,m,dp): #divide by (1-x^c) up to x^m
    for i in range(m-c+1):
        dp[i+c] += dp[i]
        dp[i+c] %= MOD

# coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline
read = sys.stdin.read

MOD = 998244353
#n = int(readline())
k,n = map(int,readline().split())

ans = [0]*(2*k+1)
dp = [1]+[0]*n
for _ in range(k-1):
    div(1,n,dp)
ans[2] = (dp[n-1]+dp[n])
for i in range(3,k+2):
    if i%2:
        mul(1,n,dp)
        ans[i] = dp[n]
    else:
        mul2(1,n,dp)
        ans[i] = dp[n-1]+dp[n]

for i in range(k+2,2*k+1):
    ans[i] = ans[2+2*k-i]

for i in ans[2:]:
    print(i%MOD)

import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def nCr(com_n, com_r):
    if com_n < com_r: return 0
    return fac[com_n] * ifac[com_r] % md * ifac[com_n - com_r] % md

def nHr(hn,hr):
    return nCr(hn+hr-1,hr)

md = 998244353
n_max = 5000
fac = [1]
for i in range(1, n_max + 1): fac.append(fac[-1] * i % md)
ifac = [1] * (n_max + 1)
ifac[n_max] = pow(fac[n_max], md - 2, md)
for i in range(n_max - 1, 1, -1): ifac[i] = ifac[i + 1] * (i + 1) % md

def solve():
    res=0
    for p in range(min(t,n)//2+1):
        cur=nCr(t//2,p)*nHr(k,n-2*p)
        if p&1:res-=cur
        else:res+=cur
        res%=md
    return res

k,n=MI()
ans=[]
for t in range(2,k+2):
    a=solve()
    ans.append(a)
    print(a)
ans.reverse()
for a in ans[1:]:print(a)


K, N = map(int, input().split())
mod = 998244353
def inved(a):
  x, y, u, v, k, l = 1, 0, 0, 1, a, mod
  while l != 0:
    x, y, u, v = u, v, x - u * (k // l), y - v * (k // l)
    k, l = l, k % l
  return x % mod

X = [0 for i in range(2*K-1)]
frac = [1]
for i in range(N + K):
  frac.append(((i+1)*frac[i])%mod)
invf = []
for i in range(N + K + 1):
  invf.append(inved(frac[i]))
for k in range(2, K+2):
  S = 0
  sign = 1
  l = k // 2
  for m in range(min(l+1, N//2+1)):
    prod = (sign * (frac[l]*frac[N+K-2*m-1])) % mod
    prod *= (invf[m]*invf[l-m]) % mod
    prod %= mod
    prod *= (invf[N-2*m] * invf[K-1]) % mod
    prod %= mod
    S += prod
    S %= mod
    sign *= -1
  X[k-2], X[2*K-k] = S, S
for i in range(2*K-1):
  print(X[i])

import sys
input = sys.stdin.readline

# K+1 - x でうつす -> i と 2K+2-i は同じ

MOD = 998244353
U = 10000
fact = [1] * (U+1)
fact_inv = [1] * (U+1)
for n in range(1,U+1):
    fact[n] = fact[n-1] * n % MOD
fact_inv[n] = pow(fact[n], MOD-2, MOD)
for n in range(U,0,-1):
    fact_inv[n-1] = fact_inv[n] * n % MOD

def comb(n,k):
    if not (0 <= k <= n):
        return 0
    return fact[n] * fact_inv[k] * fact_inv[n-k] % MOD

K,N = map(int,input().split())

def F(x,y,N):
    n = min(x, N)
    return sum(comb(x,i) * pow(2,i,MOD) * comb(N+y-1,i+y-1) for i in range(n+1)) % MOD

answer = []
for S in range(2,K+2):
    if S & 1:
        x = F((S-1)//2, K - S + 1, N)
    else:
        x = F((S-1)//2, K - S + 1, N) + F((S-1)//2, K - S + 1, N - 1)
    answer.append(x % MOD)

answer += answer[:-1][::-1]

print('\n'.join(map(str,answer)))

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 998244353
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

K,N = inpl()
MAX = K+N+10
fac = [1]*(MAX+1)
for i in range(1,MAX+1):
	fac[i] = (fac[i-1]*i)%mod

gyakugen = [1]*(MAX+1)
gyakugen[MAX] = pow(fac[MAX],mod-2,mod)
for i in range(MAX,0,-1):
	gyakugen[i-1] = (gyakugen[i]*i)%mod

def Comb(n,k):#nCk
	return (fac[n]*gyakugen[k]*gyakugen[n-k])%mod

#K=k,N=n,0pair = 0
def calc(k,n,i):
	#i=2に帰着させる
	pairs = (i-2)//2
	k -= pairs
	n -= pairs

	#色々と例外処理
	if n < 0 or k <= 0:
		return 0
	elif k == 1 and n >= 2:
		return 0

	if n == 0: 	 #球が0個なら1通り
		ans = 1
	else:
		ans = 0
		#i=2の時の数え上げ
		for x in range(2):
			ball = n-x	#球
			box = k-1	#箱
			ans += Comb(box-1+ball,ball)%mod

	ans *= pow(2,pairs,mod)	#0pairの選び方
	return ans % mod

ans = []
for i in range(2,K+2):
	if i%2 == 0:
		pairs = (i-2)//2
		tmp = 0
		for p0 in range(pairs+1): #p0 = 0pairの数
			tmp += calc(K-p0*2 , N , i-p0*2) * Comb(pairs,p0)%mod
			tmp %= mod
	ans.append(tmp)
	print(tmp)

ans = ans[::-1]
for i in range(1,K):
	print((ans[i]))


K, N = map(int, input().split())
P = 998244353
fa = [1]
for i in range(1, 10000):
    fa.append(fa[-1] * i % P)
fainv = [pow(fa[-1], P-2, P)]
for i in range(1, 10000)[::-1]:
    fainv.append(fainv[-1] * i % P)
fainv = fainv[::-1]
def C(a, b):
    if not (a >= 0 and 0 <= b <= a): return 0
    return fa[a] * fainv[a-b] * fainv[b] % P

A = []
for i in range(1, (K+1)//2+1):
    s = 0
    for j in range(i+1):
        s += C(N+K-1-2*j, K-1) * C(i, j) * (-1) ** j
        s %= P
    A.append(s)
for i in range(2*K-1):
    print(A[min(i//2, (2*K-i-2)//2)])

k,n = list(map(int,input().split()))
mod = 998244353
fact = [1]*(n+k+1)
rfact = [1]*(n+k+1)
for i in range(1, n+k):
    fact[i] = r = (i * fact[i-1]) % mod
    rfact[i] = pow(r, mod-2, mod)

save = []
for p in range(1,int((k+3)/2)):
    i = 2 * p + 1
    temp = 0
    for t in range(min(p+1,n+1)):
        if k-i+t<0:continue
        res = (fact[p] * rfact[t] * rfact[p-t]) % mod
        res *= (fact[n+k-i] * rfact[k-i+t] * rfact[n-t]) % mod
        res *= pow(2,t,mod)
        temp = (temp+res) % mod
    save.append(temp)
output = []
i = 1
while i<k:
    output.append(save[(i-1)//2])
    i+=1

for x in output+[save[-1]]+output[::-1]:
    print(x)



#!/usr/bin/env python3

M = 998244353
fact = None
factr = None

def comb(n, k):
    if n <= 0 or k < 0 or n < k:
        return 0
    r = fact[n] * factr[k] % M
    r *= factr[n - k]
    r %= M
    return r


def solve(k, n):
    nonlocal fact, factr

    inv = [1] * (k + n + 1)
    for i in range(2, k + n + 1):
        inv[i] = inv[M % i] * (M - M // i) % M
    fact = [1] * (k + n + 1)
    factr = [1] * (k + n + 1)
    for i in range(2, k + n + 1):
        fact[i] = fact[i - 1] * i % M
        factr[i] = factr[i - 1] * inv[i] % M

    if k == 1:
        print((0))
        return
    if k == 2:
        for _ in range(3):
            print((2))
        return


    g0 = (comb(k + n - 2, k - 2) + comb(k + n - 3, k - 2)) % M
    g1 = comb(k + n - 1, k - 1)

    rs0 = [0] * (min(k // 2, n // 2) + 1)
    rs1 = [0] * (min(k // 2, n // 2) + 1)
    for t in range(1, min(k // 2, n // 2) + 1):
        rs0[t] = (comb(k + n - 2 * t - 2, k - 2) + comb(k + n - 2 * t - 3, k - 2)) % M
        rs1[t] = comb(k + n - 2 * t - 1, k - 1)

    results = [0] * (k + 2)

    for i in range(2, k + 2):
        ns = (i - 1) // 2
        ans = g0 if i % 2 == 0 else g1
        p = -1
        for t in range(1, min(ns, n // 2) + 1):
            r = rs0[t] if i % 2 == 0 else rs1[t]
            r *= comb(ns, t)
            r %= M
            ans += M + p * r
            ans %= M
            p = 0 - p
        print(ans)
        results[i] = ans
    for i in range(k + 2, 2 * k + 1):
        print((results[2 * k + 2 - i]))


def main():
    k, n = input().split()
    k = int(k)
    n = int(n)

    solve(k, n)


def __starting_point():
    main()


__starting_point()

K,N=list(map(int,input().split()))
mod=998244353

INV=[None]*(N+K+2)
for i in range(1,N+K+2):
    INV[i]=pow(i,mod-2,mod)
 
Combi=[None]*(N+K+1)#Combi[i]=i C (K-1) を表す
Combi[K-1]=1
for i in range(K,N+K+1):
    Combi[i]=Combi[i-1]*i *INV[i-K+1] %mod





all=Combi[N+K-1]
ANSLIST=[]
for i in range(2,2+K):
    ANS=all
    x=i//2-max(0,(i-K-1))
    CB_x=1

    j=1
    while N+K-1-j*2>=K-1 and j<=x:
        CB_x=CB_x*(x-j+1)//j
        #print(CB_x)
        ANS+=((-1)**j)*CB_x*Combi[N+K-1-j*2]
        #print(((-1)**j)*CB_x*Combi[N+K-1-j],ANS)
        ANS=ANS%mod

        j+=1
        #print(i,j,ANS)
    
    #ANS-=x*Combi[N+K-3]
    ANSLIST.append(ANS%mod)


for i in ANSLIST:
    print(i)
ANSLIST=ANSLIST[::-1]
for j in ANSLIST[1:]:
    print(j)

    
        



def cmb(n,r):
  if n<0:
    return 0
  if n==0:
    if r!=0:
      return 0
    else:
      return 1
  elif r<0:
    return 0
  elif r>n:
    return 0
  elif r==0:
    return 1
  elif r==n:
    return 1
  else:
    return A[n]*B[r]*B[n-r]%mod
mod=998244353
A=[1,1]
B=[1,1]
for i in range(2,4005):
  A.append(A[-1]*i%mod)
  B.append(B[-1]*pow(i,mod-2,mod)%mod)
k,n=map(int,input().split())
if k==1:
  print(0)
  return
ans=[0]*(2*k+1)
for i in range(2,k+3):#i,i+1(i%2=0,i<k(くらい))で同じとか自明か？？？？？
  if i%2==0:
    i=i+1
    for j in range(min(n+1,i//2+1)):
      ans[i-1]=(ans[i-1]+cmb(n+k-i,k-i+j)*cmb(i//2,j)*pow(2,j,mod))%mod
  else:
    ans[i]=ans[i-1]
for i in range(k+2,2*k+1):
  ans[i]=ans[2*k+2-i]
for i in range(2,2*k+1):
  print(ans[i])

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 998244353
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

K,N = inpl()
MAX = K+N+10
fac = [1]*(MAX+1)
for i in range(1,MAX+1):
	fac[i] = (fac[i-1]*i)%mod

gyakugen = [1]*(MAX+1)
gyakugen[MAX] = pow(fac[MAX],mod-2,mod)
for i in range(MAX,0,-1):
	gyakugen[i-1] = (gyakugen[i]*i)%mod

def Comb(n,k):#nCk
	return (fac[n]*gyakugen[k]*gyakugen[n-k])%mod

#K=k,N=n,0pair = 0
def calc(k,n,i):
	x = (i-2)//2
	k -= x
	n -= x
	if k == 1:
		if n <= 1:
			return n
		else:
			return 0
	elif n == 0:
		return pow(2,x,mod)
	elif n < 0 or k <= 0:
		return 0

	tmp = 0
	for j in range(2):
		zb = n-j
		zm = k-2
		tmp += Comb(zb+zm,zb)%mod
	tmp %= mod
	tmp *= pow(2,x,mod)
	return tmp

ans = []
for i in range(2,K+2):
	if i%2 == 0:
		pairs = (i-2)//2
		tmp = 0
		for p0 in range(pairs+1):
			tmp += calc(K-p0*2,N,i-p0*2)*Comb(pairs,p0)%mod
			tmp %= mod
	ans.append(tmp)
	print(tmp)

ans = ans[::-1]
for i in range(1,K):
	print((ans[i]))


K,N = list(map(int, input().split()))
MAX = K+N+3
mod = 998244353

fac = [1]*(MAX+1)
for i in range(1,MAX+1):
	fac[i] = (fac[i-1]*i)%mod

rev_m = [1]*(MAX+1)
rev_m[MAX] = pow(fac[MAX],mod-2,mod)
for i in range(MAX,0,-1):
	rev_m[i-1] = (rev_m[i]*i)%mod

def Comb(n,k):#nCk
	return (fac[n]*rev_m[k]*rev_m[n-k])%mod


def f(n,k,i):
	if i == 2:
		if n < 0 or (k==1 and n>=2): #例外処理
			return 0
		elif n == 0:
			return 1
		else:
			return (Comb(k-2+n,n)+Comb(k-2+n-1,n-1)) % mod
	else: #i>2
		Sp = i//2-1
		ans = 0
		for p in range(Sp+1):
			ans += g(n,k,i,p)
		return ans % mod

def g(n,k,i,p):
	Sp = i//2-1
	if p == 0:
		return f(n-Sp,k-Sp,2) * pow(2,Sp,mod) % mod
	else: #p>0
		return g(n,k-2*p,i-2*p,0) * Comb(Sp,p)

ans = []
for i in range(2,K+2):
	if i%2 == 0:
		tmp = f(N,K,i)
	ans.append(tmp)
	print(tmp)

ans = ans[::-1]
for i in range(1,K):
	print((ans[i]))


def prepare(k, n, MOD):
    def get_factorials(m):
        f = 1
        factorials = [1]
        for m in range(1, m + 1):
            f *= m
            f %= MOD
            factorials.append(f)
        inv = pow(f, MOD - 2, MOD)
        invs = [1] * (m + 1)
        invs[m] = inv
        for m in range(m, 1, -1):
            inv *= m
            inv %= MOD
            invs[m - 1] = inv

        return factorials, invs

    def solve(p):
        """Number of patterns where no pair of p appears when n dices are rolled"""
        if cache[p] > -1:
            return cache[p]

        ret = 0
        fp = factorials[p]
        for q in range(1, min(p, n // 2) + 1):
            tmp1 = (fp * invs[q] % MOD) * invs[p - q] % MOD
            tmp2 = (factorials[k + n - 2 * q - 1] * invs[n - 2 * q] % MOD) * ik % MOD
            if q % 2 == 1:
                ret += tmp1 * tmp2
            else:
                ret -= tmp1 * tmp2
            ret %= MOD

        cache[p] = ret = (all_patterns - ret) % MOD
        return ret

    factorials, invs = get_factorials(k + n)
    ik = invs[k - 1]
    all_patterns = factorials[k + n - 1] * invs[n] * ik % MOD
    cache = [-1] * (k // 2 + 2)

    return solve


MOD = 998244353
k, n = list(map(int, input().split()))
if k == 1:
    print((0))
else:
    solve = prepare(k, n, MOD)
    ans = [solve(i // 2 - max(0, i - k - 1)) for i in range(2, k + 2)]
    print(('\n'.join(map(str, ans))))
    print(('\n'.join(map(str, ans[-2::-1]))))


def solve():
    MOD = 998244353
    maxNK = 2000

    K, N = list(map(int, input().split()))

    def getInvs(n, MOD):
        invs = [1] * (n+1)
        for x in range(2, n+1):
            invs[x] = (-(MOD//x) * invs[MOD%x]) % MOD
        return invs

    def getCombss(n, k, invs, MOD):
        def getCombNs(n, k, invs, MOD):
            combNs = [1] * (n//2+1)
            for x in range(1, n//2+1):
                combNs[x] = (combNs[x-1] * (n-x+1) * invs[x]) % MOD
            return (combNs + combNs[:(n+1)//2][::-1])[:k+1]
        combss = [[] for n in range(n+1)]
        for x in range(n+1):
            combss[x] = getCombNs(x, k, invs, MOD)
            combss[x] += [0] * (k+1-len(combss[x]))
        return combss

    invs = getInvs(2*maxNK, MOD)
    combss = getCombss(2*maxNK, maxNK, invs, MOD)

    def getPows(base, n, MOD):
        pows = [1] * (n+1)
        for x in range(1, n+1):
            pows[x] = (pows[x-1] * base) % MOD
        return pows
    pow2s = getPows(2, N, MOD)

    anss = []
    for i in range(2, K+2, 2):
        ans = 0
        numFree = abs(K+1-i)
        numPair = (K-numFree+1)//2
        numPair -= 1
        for x in range(min(numPair, N)+1):
            ans += combss[numPair][x] * pow2s[x] * combss[N+numFree-1][N-x] % MOD
            ans %= MOD
        for x in range(min(numPair, N)+1):
            ans += combss[numPair][x] * pow2s[x] * combss[N+numFree-2][N-x-1] % MOD
            ans %= MOD
        anss.append(ans)
        if i+1 <= K+1:
            anss.append(ans)

    anss = anss + anss[:-1][::-1]
    print(('\n'.join(map(str, anss))))


solve()


K,N = list(map(int, input().split()))
MAX = K+N+3
mod = 998244353

fac = [1]*(MAX+1)
for i in range(1,MAX+1):
	fac[i] = (fac[i-1]*i)%mod

rev_m = [1]*(MAX+1)
rev_m[MAX] = pow(fac[MAX],mod-2,mod)
for i in range(MAX,0,-1):
	rev_m[i-1] = (rev_m[i]*i)%mod

def Comb(n,k):#nCk
	return (fac[n]*rev_m[k]*rev_m[n-k])%mod


def f(n,k,i):
	if i == 2:
		if n < 0 or (k==1 and n>=2): #例外処理
			return 0

		if n == 0:
			ans = 1
		else:
			ans = Comb(k-2+n,n) + Comb(k-2+n-1,n-1)
		return ans % mod
	else: #i>2
		Sp = i//2-1
		ans = 0
		for p in range(Sp+1):
			ans += g(n,k,i,p)
		return ans % mod

def g(n,k,i,p):
	Sp = i//2-1
	if p == 0:
		return f(n-Sp,k-Sp,2) * pow(2,Sp,mod) % mod
	else: #p>0
		return g(n,k-2*p,i-2*p,0) * Comb(Sp,p)

ans = []
for i in range(2,K+2):
	if i%2 == 0:
		tmp = f(N,K,i)
	ans.append(tmp)
	print(tmp)

ans = ans[::-1]
for i in range(1,K):
	print((ans[i]))


K,N = (int(i) for i in input().split())
mod,ans,kn = 998244353,[],K+N
fn,fk = [1]*kn,[1]*kn
for i in range(kn-1): fn[i+1] = (fn[i]*(i+2))%mod
def power(n,k):
	if k==1: return n
	elif k%2==0: return power((n**2)%mod,k//2)
	else: return (n*power(n,k-1))%mod
def comb(n,k):
	if n==0 or k==0 or n==k: return 1
	else: return (((fn[n-1]*fk[n-k-1])%mod)*fk[k-1])%mod
fk[-1] = power(fn[-1],mod-2)
for i in range(2,kn+1): fk[-i] = (fk[-i+1]*(kn+2-i))%mod
x = comb(kn-1,N)
for i in range(2,K+2):
	num,c,y,p = N-2,1,0,i//2
	while num>-1 and c<=p:
		if c%2: y = (y+comb(p,c)*comb(K+num-1,num))%mod
		else: y = (y-comb(p,c)*comb(K+num-1,num))%mod
		num,c = num-2,c+1
	ans.append((x-y)%mod)
for i in range(2,K+2): print(ans[i-2])
for i in range(K,1,-1): print(ans[i-2])

mod=998244353
k,n=map(int,input().split())

def modinv(n):
    return pow(n,mod-2,mod)
m=n+k
Fact=[1]
for i in range(1,m+1):
    Fact.append(Fact[i-1]*i%mod)
Finv=[0]*(m+1)
Finv[-1]=modinv(Fact[-1])
for i in range(m-1,-1,-1):
    Finv[i]=Finv[i+1]*(i+1)%mod
def comb(n,r):
    if r<0 or n<r:
        return 0
    return Fact[n]*Finv[r]*Finv[n-r]%mod
def hcomb(n,r):
    return comb(n+r-1,r)
Pow=[1]*(k+1)
for i in range(k):
    Pow[i+1]=Pow[i]*2%mod
def solve(x):
    ret=0
    if x%2:
        p=x//2
        for q in range(p+1):
            ret+=Pow[q]*comb(p,q)*hcomb(k-2*p+q,n-q)
            ret%=mod
    else:
        p=x//2-1
        for q in range(p+1):
            ret+=Pow[q]*comb(p,q)*(hcomb(k-2*p+q-1,n-q)+hcomb(k-2*p+q-1,n-q-1))
            ret%=mod
    return ret
Ans=[]
for i in range(2,k+2):
    Ans.append(solve(i))
print(*Ans,sep='\n')
print(*reversed(Ans[:k-1]),sep='\n')

def prepare(n, MOD):
    f = 1
    factorials = [1]
    for m in range(1, n + 1):
        f *= m
        f %= MOD
        factorials.append(f)
    inv = pow(f, MOD - 2, MOD)
    invs = [1] * (n + 1)
    invs[n] = inv
    for m in range(n, 1, -1):
        inv *= m
        inv %= MOD
        invs[m - 1] = inv

    return factorials, invs


def solve_sub(k, n, p, factorials, invs):
    """Number of patterns where any pair(s) of p pairs appear when n dices are rolled"""
    ret = 0
    fp, ik = factorials[p], invs[k - 1]
    for q in range(1, min(p, n // 2) + 1):
        # tmp1 = factorials[p + q - 1] * invs[q] * invs[p - 1] % MOD
        tmp1 = (fp * invs[q] % MOD) * invs[p - q] % MOD
        tmp2 = (factorials[k + n - 2 * q - 1] * invs[n - 2 * q] % MOD) * ik % MOD
        if q % 2 == 1:
            ret += tmp1 * tmp2
        else:
            ret -= tmp1 * tmp2
        ret %= MOD
    return ret


def solve(k, n):
    if k == 1:
        return [0]
    factorials, invs = prepare(k + n, MOD)
    all_patterns_odd = factorials[k + n - 1] * invs[n] * invs[k - 1] % MOD
    all_patterns_even0 = factorials[k + n - 2] * invs[n] * invs[k - 2] % MOD
    all_patterns_even1 = factorials[k + n - 3] * invs[n - 1] * invs[k - 2] % MOD
    buf = []

    for i in range(2, k + 2):
        pairs = i // 2 - max(0, i - k - 1)
        if i % 2 == 0:
            ans = all_patterns_even0 - solve_sub(k - 1, n, pairs - 1, factorials, invs)
            ans += all_patterns_even1 - solve_sub(k - 1, n - 1, pairs - 1, factorials, invs)
            ans %= MOD
        else:
            ans = (all_patterns_odd - solve_sub(k, n, pairs, factorials, invs)) % MOD
        buf.append(ans)

    return buf


MOD = 998244353
k, n = list(map(int, input().split()))
ans = solve(k, n)
print(('\n'.join(map(str, ans))))
print(('\n'.join(map(str, ans[-2::-1]))))


K, N = map(int, input().split())
MOD = 998244353

P = N+K
fact = [1]*(P+1)
rfact = [1]*(P+1)
for i in range(P):
    fact[i+1] = r = ((i+1) * fact[i]) % MOD
    rfact[i+1] = pow(r, MOD-2, MOD)

def comb(n, k):
    return fact[n] * rfact[k] * rfact[n-k] % MOD

V = [1]*(P+1)
r = 1
for i in range(P):
    r = (r * 2) % MOD
    V[i+1] = r * rfact[i+1] % MOD

memo = {}
def calc(A):
    if A in memo:
        return memo[A]
    M = A//2
    r = 0
    if A % 2:
        p = K - 2*M + N - 2
        for m in range(max(0, 2*M+2-K), min(M, N-1)+1):
            r += V[m] * rfact[M-m] * (fact[p]*rfact[N-m] + fact[p-1]*rfact[N-m-1])*rfact[p-N+m] % MOD

        if 2*M+2-K <= N <= M:
            r += V[N] * rfact[M-N] % MOD
        r *= fact[M]
    else:
        p = K - 2*M + N - 1
        for m in range(max(0, 2*M+1-K), min(N, M)+1):
            r += V[m] * rfact[M-m] * rfact[N-m] * rfact[p-N+m] % MOD
        r *= fact[M] * fact[p]
    r = memo[A] = r % MOD
    return r
ans = []
for i in range(2, 2*K+1):
    if i <= K:
        ans.append(calc(i - 1))
    else:
        ans.append(calc(2*K - i + 1))
print(*ans, sep='\n')


mod = 998244353
rng = 4100
fctr = [1]
finv = [1]
for i in range(1,rng):
  fctr.append(fctr[-1]*i%mod)
for i in range(1,rng):
  finv.append(pow(fctr[i],mod-2,mod))
def cmb(n,k):
  if n<0 or k<0:
    return 0
  else:
    return fctr[n]*finv[n-k]*finv[k]%mod
def homo(n,k):
  if n<0 or k<=0:
    return 0
  else:
    return cmb(n+k-1,k-1)
k,n = map(int,input().split())
if k%2 == 0:
  flg = 0
else:
  flg = 1
ans = []
for i in range(3,k+2,2):
  ic = (i-1)//2
  anstmp = 0
  for j in range(ic+1):
    t = homo(n-j,(k-ic*2+j))*cmb(ic,j)*pow(2,j,mod)
    anstmp = (anstmp+t)%mod
  ans.append(anstmp)
  ans.append(anstmp)
if flg:
  anstmp = 0
  for j in range(1,k//2+1):
    t = (homo(n-j,j)+homo(n-j-1,j))*cmb(k//2,j)*pow(2,j,mod)
    anstmp = (anstmp+t)%mod
  ans.append(anstmp)
ans2 = ans[:-1]
ans2 = ans2[::-1]
print(*ans,sep="\n")
print(*ans2,sep="\n")

import sys

K, N = list(map(int, input().split()))
P = 998244353


kaizyo = [0]
kaizyo_inv = [0]
tmp = 1
for i in range(1, N+K):
    tmp = (tmp*i) % P
    kaizyo.append(tmp)
    kaizyo_inv.append(pow(tmp, P - 2, P))


def comb(n, r):
    if n < r or r < 0:
        return 0
    elif n == r or r == 0:
        return 1
    else:
        return kaizyo[n] * kaizyo_inv[r] * kaizyo_inv[n - r]


inv_2 = pow(2, P - 2, P)
anss = ''
for i in range(2, 2 * K + 1):
    ans = 0
    n_pair = min((i - 1) // 2, (2 * K - i + 1) // 2)
    out_pair = max(0, K - i + 1, i - K - 1)
    which_use = pow(2, n_pair+1, P)
    for j in range(n_pair + 1):
        if n_pair - j > N:
            which_use = (which_use * inv_2) % P
            continue
        not_use = comb(n_pair, j)
        which_use = (which_use * inv_2) % P
        dice_cnt = comb(N - 1 + out_pair, n_pair - j - 1 + out_pair)
        if i % 2 == 0:
            dice_cnt = (dice_cnt + comb(N - 2 + out_pair,
                                        n_pair - j - 1 + out_pair)) % P
        tmp = (not_use * which_use) % P
        tmp = (tmp * dice_cnt) % P
        ans = (ans + tmp) % P
    anss += str(ans) + '\n'
print((anss.rstrip()))


MOD = 998244353
k, n = list(map(int, input().split()))

facts = [1]
invs = [1]
pow2 = [1]
for i in range(1, n+k):
    f = i*facts[i-1]%MOD
    facts.append(f)
    invs.append(pow(f, MOD-2, MOD))
    pow2.append(2**i%MOD)

def nCk(n, k):
    return (facts[n]*invs[k]*invs[n-k])%MOD
def nHk(n, k):
    return nCk(n+k-1, n-1)

ans = []
for i in range(2, k+2):
    p = i//2
    ans_i = 0
    for q in range(min(p+1, n+1)):
        if k-i+q < 0:
            continue
        if i%2 > 0: # odd
            ans_i = ans[-1]
            break
            # ans_iq = pow2[q]*nCk(p, q)*nHk(k-(i-1)+q, n-q)%MOD
        else: # even
            ans_iq = 0
            if q > 0 and k-i+q > 0:
                ans_iq = (ans_iq+pow2[q-1]*nCk(p-1, q-1)*nHk(k-(i-1)+(q-1), n-q))%MOD
            if q < p:
                ans_iq = (ans_iq+pow2[q]*nCk(p-1, q)*nHk(k-(i-1)+q, n-q))%MOD
            # print(ans_iq)
        ans_i = (ans_i + ans_iq)%MOD
    ans.append(ans_i)

for a in ans+ans[-2::-1]:
    print(a)


K, N = map(int, input().split())
mod = 998244353
A = []
p = mod - 2
while p != 0:
  A = [p%2] + A[:]
  p //= 2
def inved(x):
  y = 1
  for _ in range(len(A)):
    if A[_] == 1:
      y *= x
      y %= mod
    if _ != len(A) - 1:
      y *= y
      y %= mod
  return y

X = [0 for i in range(2*K-1)]
frac = [1]
for i in range(N + K):
  frac.append(((i+1)*frac[i])%mod)
invf = []
for i in range(N + K + 1):
  invf.append(inved(frac[i]))
for k in range(2, K+2):
  S = 0
  sign = 1
  l = k // 2
  for m in range(min(l+1, N//2+1)):
    prod = (sign * (frac[l]*frac[N+K-2*m-1])) % mod
    prod *= (invf[m]*invf[l-m]) % mod
    prod %= mod
    prod *= (invf[N-2*m] * invf[K-1]) % mod
    prod %= mod
    S += prod
    S %= mod
    sign *= -1
  X[k-2], X[2*K-k] = S, S
for i in range(2*K-1):
  print(X[i])

class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv
mod = 998244353
K, N = map(int, input().split())
comb = Combination(10000, mod=mod)
def C(n, r):
    if n<r or r<0:
        return 0
    else:
        return comb(n, r)
def H(n, r):
    return C(n+r-1, r)
L = []
for i in range(2, 2*K+1, 2):
    ans = 0
    M = i//2
    b = 1
    for j, a in enumerate(range(M, K)):
        if M-j<0:
            break
        ans += pow(2, M-j, mod) * C(M, j) * H(K-a, N) * b
        #print((j, a), C(M, j) , H(N, K-a), b, pow(2, M-j, mod) * C(M, j) * H(K-a, N) * b)
        ans %= mod
        b = -b
    print(ans)
    if i == K+1:
        break
    elif i == K:
        print(ans)
        print(ans)
        break
    L.append(ans)
    print(ans)
    L.append(ans)

print(*L[::-1], sep="\n")


from collections import Counter
K, N = map(int, input().split())
mod = 998244353
frac = [1]*5010
for i in range(2,5010):
    frac[i] = i * frac[i-1]%mod
fraci = [None]*5010
for i in range(5010):
    fraci[i] = pow(frac[i], mod-2, mod)
def comb(a, b):
    if not a >= b >= 0:
        return 0
    return frac[a]*fraci[b]*fraci[a-b]%mod
A = Counter()
def calc(x):
    if A[x]:
        return A[x]
    res = 0
    for i in range(N//2+1):
        res = (res + (-1)**i*comb(x, i)*comb(N+K-1-2*i, N-2*i))%mod
    A[x] = res
    return res
for j in range(2, 2*K+1):
    print(calc(min(j, (2*K+2-j))//2))

k,n = map(int,input().split())
mod = 998244353

max_n = 5000
fac, finv, inv = [0]*max_n, [0]*max_n, [0]*max_n

def comInit(max_n):
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1

    for i in range(2,max_n):
      fac[i] = fac[i-1]* i% mod
      inv[i] = mod - inv[mod%i] * (mod // i) % mod
      finv[i] = finv[i-1] * inv[i] % mod

comInit(max_n)

# 二項係数の計算
def com(n,k):
    if(n < k):
        return 0
    if( (n<0) | (k < 0)):
        return 0
    return fac[n] * (finv[k] * finv[n-k] % mod) % mod

ex2 = [1]*1010
for i in range(1,1010):
    ex2[i] = (ex2[i-1]*2)%mod

ans = []
for j in range(2,k+2):
    tmp = 0
    x = (j-1)//2
    for i in range(j//2 + 1):
        comb1 = com(n+k-j,n-i)
        comb2 = (com(x,i) * ex2[i])%mod
        if(j%2==0):
            comb1 += com(n+k-j-1,n-i-1)
            comb1 %= mod
        tmp += comb1*comb2
        tmp %= mod

    ans.append(tmp)

ans2 = ans[:-1]
ans += ans2[::-1]
print('\n'.join(map(str,ans)))

# Acknowledge: https://atcoder.jp/contests/arc102/submissions/3127544
MOD = 998244353
k, n = list(map(int, input().split()))

facts = [1]
invs = [1]
for i in range(1, n+k):
    f = (i*facts[i-1])%MOD
    facts.append(f)
    invs.append(pow(f, MOD-2, MOD))

def nCk(n, k):
    return (facts[n]*invs[k]*invs[n-k])%MOD

memo = []
for p in range(1, (k+3)//2):
    i = 2*p+1
    tmp = 0
    for t in range(min(p+1, n+1)):
        if k-i+t < 0:
            continue
        res = nCk(p, t)
        res *= nCk(n+k-i, k-i+t)
        res *= pow(2, t, MOD)
        tmp = (tmp+res)%MOD
    memo.append(tmp)

ans = []
for i in range(1, k):
    ans.append(memo[(i-1)//2])
for a in ans+[memo[-1]]+ans[::-1]:
    print(a)


mod=998244353
K,N=list(map(int,input().split()))

Factorial=[1]*(N+K+1)
for i in range(1,N+K+1):
  Factorial[i]=Factorial[i-1]*(i)%mod
def power(x,y):
  if y==0:
    return 1
  elif y==1:
    return x%mod
  elif y%2==0:
    return power(x,y//2)**2%mod
  else:
    return (power(x,y//2)**2)*x%mod

inverseFactorial=[1]*(N+K+1)
inverseFactorial[N+K]=power(Factorial[N+K],mod-2)
for i in range(0,N+K)[::-1]:
  inverseFactorial[i]=(inverseFactorial[i+1]*(i+1))%mod
  
def C(x,y):
  if x<y or y<0:
    return 0
  else:
    return (Factorial[x]*inverseFactorial[y]*inverseFactorial[x-y])%mod
def H(x,y):
  return C(x+y-1,y)

def ans(M,N,K):
  res=0
  for m in range(1,M+1)[::-1]:
    if m%2:
      res+=C(M,m)*H(K,N-2*m)
    else:
      res+=(-1)*C(M,m)*H(K,N-2*m)
  return (H(K,N)-res)%mod
  

for i in range(2,2*K+1):
  if i%2:
    print((ans(min(K,i-1)-i//2,N,K)))
  else:
    print(((ans(min(K,i-1)-i//2,N-1,K-1)+ans(min(K,i-1)-i//2,N,K-1))%mod))