M=998244353

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

a=0

c=1

for i in range(k+1):

  a+=c*m*pow(m-1,n-i-1,M)

  c=c*(n-i-1)*pow(i+1,M-2,M)%M

print((a%M))
M=998244353

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

a,c=0,1

for i in range(k+1):

  a+=c*m*pow(m-1,n+~i,M)

  c=c*(n+~i)*pow(i+1,-1,M)%M

print((a%M))
M = 998244353
n, m, k = list(map(int, input().split()))
a = 0
c = 1
for i in range(k + 1):
    a += c * m * pow(m - 1, n - i - 1, M)
    c = c * (n - i - 1) * pow(i + 1, M - 2, M) % M
print((a % M))

M = 998244353
n, m, k = list(map(int, input().split()))
a, c = 0, 1
for i in range(k + 1):
    a += c * m * pow(m - 1, n + ~i, M)
    c = c * (n + ~i) * pow(i + 1, -1, M) % M
print((a % M))

-a = 0 -c = 1 +a, c = 0, 1 -    a += c * m * pow(m - 1, n - i - 1, M) -    c = c * (n - i - 1) * pow(i + 1, M - 2, M) % M +    a += c * m * pow(m - 1, n + ~i, M) +    c = c * (n + ~i) * pow(i + 1, -1, M) % M