n,m=list(map(int,input().split()))

w,u=3*m,n-1

o,f,i=998244353,[1],1

while i<w+n:f+=[f[-1]*i%o];i+=1

c=lambda n,k=u:f[n]*pow(f[n-k],o-2,o)*pow(f[k],o-2,o)

a=c(w+u)-n*c(n+m-2)

while~-n>m<w:m+=2;a-=c(n,m)*c(2*u+w-m>>1)

print((a%o))
n,m=list(map(int,input().split()))

o,f,i=998244353,[1],1

while i<3*m+n:f+=[f[-1]*i%o];i+=1

c=lambda x,y=n-1:f[x]*pow(f[x-y]*f[y]%o,o-2,o)

a=c(-1)-n*c(n+m-2)

while~-n>m<i-n:m+=2;a-=c(n,m)*c(n-1+i-m>>1)

print((a%o))
n, m = list(map(int, input().split()))
w, u = 3 * m, n - 1
o, f, i = 998244353, [1], 1
while i < w + n:
    f += [f[-1] * i % o]
    i += 1
c = lambda n, k=u: f[n] * pow(f[n - k], o - 2, o) * pow(f[k], o - 2, o)
a = c(w + u) - n * c(n + m - 2)
while ~-n > m < w:
    m += 2
    a -= c(n, m) * c(2 * u + w - m >> 1)
print((a % o))

n, m = list(map(int, input().split()))
o, f, i = 998244353, [1], 1
while i < 3 * m + n:
    f += [f[-1] * i % o]
    i += 1
c = lambda x, y=n - 1: f[x] * pow(f[x - y] * f[y] % o, o - 2, o)
a = c(-1) - n * c(n + m - 2)
while ~-n > m < i - n:
    m += 2
    a -= c(n, m) * c(n - 1 + i - m >> 1)
print((a % o))

-w, u = 3 * m, n - 1 -while i < w + n: +while i < 3 * m + n: -c = lambda n, k=u: f[n] * pow(f[n - k], o - 2, o) * pow(f[k], o - 2, o) -a = c(w + u) - n * c(n + m - 2) -while ~-n > m < w: +c = lambda x, y=n - 1: f[x] * pow(f[x - y] * f[y] % o, o - 2, o) +a = c(-1) - n * c(n + m - 2) +while ~-n > m < i - n: -    a -= c(n, m) * c(2 * u + w - m >> 1) +    a -= c(n, m) * c(n - 1 + i - m >> 1)