CodeEff/ECCO huggingface dataset:
# Original solution
import sys,os
from collections import defaultdict, deque
from math import ceil, floor, inf
if sys.version_info[1] >= 5:
    from math import gcd
else:
    from fractions import gcd
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
class Combinations:
    def __init__(self,n,p):
        self.n = n
        self.p = p
        self.g1 = [1,1]
        self.g2 = [1,1]
        inverse = [0,1]
        for i in range(2, self.n + 1):
            self.g1.append( ( self.g1[-1] * i ) % self.p )
            inverse.append( ( -inverse[self.p % i] * (self.p//i) ) % self.p )
            self.g2.append( (self.g2[-1] * inverse[-1]) % self.p )
    def nCr(self,r):
        if r < 0 or self.n < r:
            return 0
        r = min(r, self.n-r)
        return self.g1[self.n] * self.g2[r] * self.g2[self.n-r] % self.p

def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    MOD =  998244353

    N,M,K = LMIIS()
    ans = 0
    cmb = Combinations(N-1,MOD)
    #i個のブロックを連結、全体でN-i個、どこを連結させるかは(N-1)Ci通り
    for i in range(K,-1,-1):
        ans += M * pow(M-1,N-i-1,MOD) * cmb.nCr(i)
        ans %= MOD
    print(ans)

    

if __name__ == '__main__':
    main()


# Optimized solution
import sys,os
from collections import defaultdict, deque
from math import ceil, floor, inf
if sys.version_info[1] >= 5:
    from math import gcd
else:
    from fractions import gcd
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
class Combinations:
    def __init__(self,n,p):
        self.n = n
        self.p = p
        self.g1 = [1,1]
        self.g2 = [1,1]
        inverse = [0,1]
        for i in range(2, self.n + 1):
            self.g1.append( ( self.g1[-1] * i ) % self.p )
            inverse.append( ( -inverse[self.p % i] * (self.p//i) ) % self.p )
            self.g2.append( (self.g2[-1] * inverse[-1]) % self.p )
    def nCr(self,r):
        if r < 0 or self.n < r:
            return 0
        r = min(r, self.n-r)
        return self.g1[self.n] * self.g2[r] * self.g2[self.n-r] % self.p

def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    MOD =  998244353

    N,M,K = LMIIS()
    ans = 0
    cmb = Combinations(N-1,MOD)
    #i個のブロックを連結、全体でN-i個、どこを連結させるかは(N-1)Ci通り
    powtable = [0] * N
    powtable[N-K-1] = M * pow(M-1,N-K-1,MOD) % MOD
    for i in range(N-K,N):
        powtable[i] = powtable[i-1] * (M-1) % MOD

    for i in range(K+1):
        ans += powtable[N-i-1] * cmb.nCr(i)
        ans %= MOD
    # for i in range(K+1):
    #     ans += M * pow(M-1,N-i-1,MOD) * cmb.nCr(i)
    #     ans %= MOD
    print(ans)

    

if __name__ == '__main__':
    main()
# Original solution
mod=998244353
def mod_pow(x,n):
    res=1
    while n>0:
        if n&1:
            res=res*x%mod
        x=x*x%mod
        n>>=1
    return res
def inverse_element(t):
    return mod_pow(t,mod-2)

n,m,k=list(map(int,input().split()))
ans=0
p1=m*mod_pow(m-1,n-1)%mod
p2=1
for i in range(0,k+1):
    ans+=p1*p2%mod
    ans%=mod
    p1*=inverse_element(m-1)
    p2*=(n-i-1)
    p2*=inverse_element(i+1)
    p1%=mod
    p2%=mod
print(ans)

# Optimized solution
mod=998244353
def mod_pow(x,n):
    res=1
    while n>0:
        if n&1:
            res=res*x%mod
        x=x*x%mod
        n>>=1
    return res
def inverse_element(t):
    return mod_pow(t,mod-2)

n,m,k=list(map(int,input().split()))
if m==1:
    if k==n-1:
        print(m)
    else:
        print((0))
    exit(0)
ans=0
p1=m*mod_pow(m-1,n-1)%mod
p2=1
for i in range(0,k+1):
    ans+=p1*p2%mod
    ans%=mod
    p1*=inverse_element(m-1)
    p2*=(n-i-1)
    p2*=inverse_element(i+1)
    p1%=mod
    p2%=mod
print((ans%mod))
# Original solution
# from math import factorial
from sys import exit
n,m,k = list(map(int, input().split()))
if m == 1:
    if k == n-1:
        print((1))
    else:
        print((0))
    exit()
MOD = 998244353

ans = tmp = (m * (m-1) ** (n-1))
ans %= MOD

for i in range(k):
    tmp *= (n-1-i)
    tmp //= (m-1) * (i+1)
    ans += tmp
    ans %= MOD

print(ans)

# Optimized solution
# from math import factorial
from sys import exit
n,m,k = list(map(int, input().split()))
if m == 1:
    if k == n-1:
        print((1))
    else:
        print((0))
    exit()
MOD = 998244353

ans = tmp = (m * (m-1) ** (n-1)) % MOD

for i in range(k):
    tmp *= (n-1-i)
    tmp %= MOD
    tmp *= pow((m-1) * (i+1), -1, MOD)
    ans += tmp
    ans %= MOD

print(ans)
# Original solution
from sys import stdin, stdout

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: list(map(int, stdin.readline().split()))

INF, NINF = float('inf'), float('-inf')

def binom_tables(n, q):
	fact = [1 for _ in range(n + 1)]
	inv = [1 for _ in range(n + 1)]
	for i in range(1, n+1):
		fact[i] = (fact[i-1] * i) % q
		inv[i] = pow(fact[i], q-2, q)
	return fact, inv

def binom(n, k, q, F, I):
	return (F[n]*((I[k]*I[n-k])%q))%q

def main():
	MOD = 998244353
	n, m, k = rli()
	F, I = binom_tables(n, MOD)
	ans = 0
	for i in range(n-k, n+1):
		ans += (binom(n-1, i-1, MOD, F, I)*m*pow(m-1, i-1, MOD))%MOD
	print((ans % MOD))

if __name__ == "__main__":
	main()

# Optimized solution
from sys import stdin, stdout

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: list(map(int, stdin.readline().split()))

INF, NINF = float('inf'), float('-inf')

def binom_tables(n, q):
	fact = [1 for _ in range(n + 1)]
	inv = [1 for _ in range(n + 1)]
	for i in range(1, n+1):
		fact[i] = (fact[i-1] * i) % q
		inv[i] = pow(fact[i], q-2, q)
	return fact, inv

def main():
	MOD = 998244353
	n, m, k = rli()
	F, I = binom_tables(n, MOD)
	
	def binom(n, k, q):
		return (F[n]*((I[k]*I[n-k])%q))%q

	ans = 0
	for i in range(n-k, n+1):
		ans += (binom(n-1, i-1, MOD)*m*pow(m-1, i-1, MOD))%MOD
	print((ans % MOD))

if __name__ == "__main__":
	main()
# Original solution
mod = 998244353 #出力の制限
N = 2 * (10**5)
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

def nCr(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

def nPr(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[n-r] % mod

def main():
    N, M, K = list(map(int, input().split()))

    ans = 0
    for i in range(0, K + 1):
        # N-i個のボールを隣り合う色が必ず異なるようにする並べ方
        # 最初はM通り、それ以降は前の色とは違うM-1通り
        # = M * (M - 1) * (M - 1) * ... = M * (M - 1)^(N - i - 1)
        base = M * pow(M - 1, N - i - 1, mod)
        # 同じ色のボールを追加する場所をi箇所選ぶ
        # = 最初以外の N - 1箇所から、「前の色と同じ」を設定する場所をi箇所選ぶ
        # = nCr(N - 1, i)
        patterns = base * nCr(N - 1, i, mod)
        # print(i, base, nCr(N - 1, i, mod), patterns)
        
        ans = (ans + patterns) % mod
    
    print(ans)

if __name__ == '__main__':
    main()

# Optimized solution

class ModCombination():
    def __init__(self, n, mod=998244353):
        self.mod = mod
        self.N = n
        fact = [1, 1] # 元テーブル
        ifact = [1, 1] #逆元テーブル
        inverse = [0, 1] #逆元テーブル計算用テーブル

        for i in range( 2, n + 1 ):
            fact.append( ( fact[-1] * i ) % mod )
            inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
            ifact.append( (ifact[-1] * inverse[-1]) % mod )
        
        self.fact = fact
        self.ifact = ifact
        self.inverse = inverse

    def nCr(self, n, r):
        if r < 0 or r > n:
            return 0
        return self.fact[n] * self.ifact[r] * self.ifact[n-r] % self.mod

    def nPr(self, n, r):
        if r < 0 or r > n:
            return 0
        return self.fact[n] * self.ifact[n-r] % self.mod

def main():
    N, M, K = list(map(int, input().split()))
    MOD = 998244353
    mc = ModCombination(N, MOD)

    ans = 0
    for i in range(0, K + 1):
        # N-i個のボールを隣り合う色が必ず異なるようにする並べ方
        # 最初はM通り、それ以降は前の色とは違うM-1通り
        # = M * (M - 1) * (M - 1) * ... = M * (M - 1)^(N - i - 1)
        base = M * pow(M - 1, N - i - 1, MOD)
        # 同じ色のボールを追加する場所をi箇所選ぶ
        # = 最初以外の N - 1箇所から、「前の色と同じ」を設定する場所をi箇所選ぶ
        # = nCr(N - 1, i)
        patterns = base * mc.nCr(N - 1, i)
        # print(i, base, mc.nCr(N - 1, i, mod), patterns)
        
        ans = (ans + patterns) % MOD
    
    print(ans)

if __name__ == '__main__':
    main()
# Original solution
N,M,K = list(map(int,input().split()))

MOD = 998244353
cmbarr = [1] * (N)
for r in range(N-1):
    cmbarr[r+1] = cmbarr[r] * (N - 1 - r) // (r + 1)

A = [M*pow(M-1,N-1-i,MOD) % MOD for i in range(K+1)]
A = [A[i] * cmbarr[i] % MOD for i in range(K+1)]
print((sum(A) % MOD))

# Optimized solution
N,M,K = list(map(int,input().split()))
MOD = 998244353

fac = [1] * (N+1)
inv = [1] * (N+1)
ifac = [1] * (N+1)
for i in range(2,N+1):
    fac[i]=(fac[i-1]*i)%MOD
    inv[i]= -(inv[MOD%i]*(MOD//i))%MOD
    ifac[i]=(ifac[i-1]*inv[i])%MOD

cmbarr = [1] * N
for r in range(N-1):
    cmbarr[r+1] = cmbarr[r] * (N - 1 - r) * inv[r + 1] % MOD

A = [M*pow(M-1,N-1-i,MOD)*cmbarr[i] % MOD for i in range(K+1)]
print((sum(A) % MOD))
# Original solution
n, m, k = list(map(int, input().split()))
# tmp = m
mod = 998244353
ans = m * pow(m-1, n-1, mod)
ans %= mod
ncm = 1
for i in range(k):
    ncm *= n-1-i
    ncm *= pow(i+1, mod-2, mod)
    ans += m * pow(m-1, n-i-2, mod) * ncm
    ans %= mod
print(ans)


# Optimized solution
n, m, k = list(map(int, input().split()))
# tmp = m
mod = 998244353
ans = m * pow(m-1, n-1, mod)
ans %= mod
ncm = 1
ncm_list = [0 for _ in range(k)]
for i in range(k):
    ncm *= n-1-i
    ncm *= pow(i+1, mod-2, mod)
    ncm %= mod
    ncm_list[i] = ncm

powm_list = [0 for _ in range(k)]
tmp = m * pow(m-1, n-k-1, mod)
if k != 0:
    powm_list[k-1] = tmp
    for i in range(k-2, -1, -1):
        tmp *= (m-1)
        tmp %= mod
        powm_list[i] = tmp

for i in range(k):
    ans += ncm_list[i] * powm_list[i]
    ans %= mod

print(ans)
# Original solution
N, M, K = list(map(int, input().split()))
mod = 998244353
MAX_N = 2 * (10**5)

fact = [1]
fact_inv = [0] * (MAX_N + 4)

for i in range(MAX_N + 3):
    fact.append(fact[-1]*(i+1)%mod)

fact_inv[-1] = pow(fact[-1],mod-2,mod)
for i in range(MAX_N+2,-1,-1):
    fact_inv[i] = fact_inv[i+1]*(i+1)%mod

def cmb(n,k,mod):
    return fact[n] * fact_inv[k] % mod * fact_inv[n-k] %mod

ans = 0
col = M

for k in range(N-1, -1, -1):
    now = col
    now *= cmb(N-1,k,mod)
    if k <= K:
        ans += now
    ans %= mod
    col *= M-1

print(ans)



# Optimized solution
N, M, K = list(map(int, input().split()))
mod = 998244353

fact = [1 for i in range(N+1)]
fact_inv = [1 for i in range(N+1)]

for i in range(1, N+1):
    fact[i] = fact[i-1] * i % mod
    fact_inv[i] = pow(fact[i], mod-2, mod)

def cmb(n,k):
    return fact[n] * fact_inv[k] % mod * fact_inv[n-k] %mod

ans = 0

for k in range(K+1):
    now = M * pow(M-1, N-k-1, mod) * cmb(N-1,k)
    ans = (ans + now % mod) % mod

print(ans)
# Original solution
n,m,k=list(map(int,input().split()))
mod=998244353
ans=0
def mfact(n,mod):
    f=[1]
    for i in range(1,n+1):
        f.append(f[-1]*i%mod)
    return f
f=mfact(n,mod)
for i in range(k+1):
    ans=(ans+(m*pow(m-1,n-i-1,mod)*f[n-1]*pow(f[n-1-i],mod-2,mod)*pow(f[i],mod-2,mod)))%mod
print(ans)

# Optimized solution
n,m,k=list(map(int,input().split()))
mod=998244353
ans=0
def mfact(n,mod):
    f=[1]
    for i in range(1,n+1):
        f.append(f[-1]*i%mod)
    return f
f=mfact(n,mod)
for i in range(k+1):
    ans+=(m*pow(m-1,n-i-1,mod)*(f[n-1]*pow(f[n-1-i],mod-2,mod)*pow(f[i],mod-2,mod))%mod)%mod
print((ans%mod))
# Original solution
M=998244353
n,m,k=list(map(int,input().split()))
a=m*pow(m-1,n-1,M)
c=1
for i in range(1,k+1):
  t=m*pow(m-1,n-i-1,M)
  c=c*(n-i)*pow(i,M-2,M)
  a+=t*c%M
print((a%M))

# Optimized solution
M=998244353
n,m,k=list(map(int,input().split()))
p,c=[m]*n,[1]*n
for i in range(1,n):
  p[i]=p[i-1]*(m-1)%M
  c[i]=c[i-1]*(n-i)*pow(i,M-2,M)%M
print((sum(p[n-i-1]*c[i]%M for i in range(k+1))%M))
# Original solution
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))

# Optimized solution
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))
# Original solution
# E - Colorful Blocks
import sys
readline = sys.stdin.readline

MOD = 998244353
N, M, K = list(map(int, readline().split()))

def pow_mod(x, n, mod):
    ans = 1
    while n>0:
        if n&1==1:
            ans = (ans * x)%mod
        x = (x * x)%mod
        n >>= 1
    return ans

f = [1]
for i in range(N):
    f.append(f[i]*(i+1)%MOD)

def comb_mod(n, r, p):
    return (f[n] * pow_mod(f[r], p-2, p) * pow_mod(f[n-r], p-2, p))%p

ans = 0
for i in range(K+1):
    ans = (ans + (M*pow_mod(M-1, N-1-i, MOD)) * comb_mod(N-1, i, MOD))%MOD

print(ans)


# Optimized solution
# E - Colorful Blocks
import sys
readline = sys.stdin.readline

MOD = 998244353
N, M, K = list(map(int, readline().split()))

# 予め階乗を計算しておく
f = [1]
for i in range(N):
    f.append(f[i] * (i+1) % MOD)

f_inv = [1] * N
f_inv[N-1] = pow(f[N-1], MOD-2, MOD)
for i in range(N-1)[::-1]:
    f_inv[i] = f_inv[i+1] * (i+1) % MOD

# 組み合わせ関数
def comb_mod(n, r, p):
    return (f[n] * pow(f[r], p-2, p) * pow(f[n-r], p-2, p))%p

ans = 0
for i in range(K+1):
    ans = (ans + (M*pow(M-1, N-1-i, MOD)) * comb_mod(N-1, i, MOD))%MOD

print(ans)
# Original solution
# E - Colorful Blocks
import sys
readline = sys.stdin.readline

MOD = 998244353
N, M, K = list(map(int, readline().split()))

# 予め階乗を計算しておく
f = [1]
for i in range(N):
    f.append(f[i] * (i+1) % MOD)

f_inv = [1] * N
f_inv[N-1] = pow(f[N-1], MOD-2, MOD)
for i in range(N-1)[::-1]:
    f_inv[i] = f_inv[i+1] * (i+1) % MOD

# 組み合わせ関数
def comb_mod(n, r, p):
    return (f[n] * pow(f[r], p-2, p) * pow(f[n-r], p-2, p))%p

ans = 0
for i in range(K+1):
    ans = (ans + (M*pow(M-1, N-1-i, MOD)) * comb_mod(N-1, i, MOD))%MOD

print(ans)


# Optimized solution
# E - Colorful Blocks
import sys
readline = sys.stdin.readline

MOD = 998244353
N, M, K = list(map(int, readline().split()))

# 予め階乗を計算しておく
f = [1]
for i in range(N):
    f.append(f[i] * (i+1) % MOD)

f_inv = [1] * N
f_inv[N-1] = pow(f[N-1], MOD-2, MOD)
for i in range(N-1)[::-1]:
    f_inv[i] = f_inv[i+1] * (i+1) % MOD

# 組み合わせ関数
def comb_mod(n, r, p):
    return (f[n] * f_inv[r] * f_inv[n-r])%p

ans = 0
for i in range(K+1):
    ans = (ans + (M*pow(M-1, N-1-i, MOD)) * comb_mod(N-1, i, MOD))%MOD

print(ans)
# Original solution
# coding: utf-8


def bpow(x, y, z):
    a = 1
    for b in format(y, 'b'):
        a = (a*a) % z
        if b == '1':
            a = (a*x) % z
        y >>= 1
    return a


def solve(*args: str) -> str:
    n, m, k = list(map(int, args[0].split()))
    mod = 998244353

    ret = m*bpow(m-1, n-1, mod) % mod
    ncr = 1
    for i in range(1, k+1):
        ncr = ncr*(n-i)//i
        ret += m*bpow(m-1, n-1-i, mod)*ncr % mod

    return str(ret % mod)


if __name__ == "__main__":
    print((solve(*(open(0).read().splitlines()))))


# Optimized solution
# coding: utf-8


def bpow(x, y, z):
    a = 1
    for b in format(y, 'b'):
        a = (a*a) % z
        if b == '1':
            a = (a*x) % z
    return a


def solve(*args: str) -> str:
    n, m, k = list(map(int, args[0].split()))
    mod = 998244353

    if m == 1 and n-1 == k:
        return str(1)

    ncr = 1
    p = m*bpow(m-1, n-1, mod) % mod
    ret = p
    inv = bpow(m-1, mod-2, mod)
    for i in range(1, k+1):
        ncr = (ncr * (n-i)*bpow(i, mod-2, mod)) % mod
        p = (p*inv) % mod
        ret += p*ncr % mod

    return str(ret % mod)


if __name__ == "__main__":
    print((solve(*(open(0).read().splitlines()))))
# Original solution
# coding: utf-8


def bpow(x, y, z):
    a = 1
    for b in format(y, 'b'):
        a = (a*a) % z
        if b == '1':
            a = (a*x) % z
    return a


def solve(*args: str) -> str:
    n, m, k = list(map(int, args[0].split()))
    mod = 998244353

    if m == 1 and n-1 == k:
        return str(1)

    ncr = 1
    p = m*bpow(m-1, n-1, mod) % mod
    ret = p
    inv = bpow(m-1, mod-2, mod)
    for i in range(1, k+1):
        ncr = (ncr * (n-i)*bpow(i, mod-2, mod)) % mod
        p = (p*inv) % mod
        ret += p*ncr % mod

    return str(ret % mod)


if __name__ == "__main__":
    print((solve(*(open(0).read().splitlines()))))


# Optimized solution
# coding: utf-8


def solve(*args: str) -> str:
    n, m, k = list(map(int, args[0].split()))
    mod = 998244353

    if m == 1 and n-1 == k:
        return str(1)

    ncr = 1
    p = m*pow(m-1, n-1, mod) % mod
    ret = p
    inv = pow(m-1, mod-2, mod)
    for i in range(1, k+1):
        ncr = (ncr * (n-i)*pow(i, mod-2, mod)) % mod
        p = (p*inv) % mod
        ret += p*ncr % mod

    return str(ret % mod)


if __name__ == "__main__":
    print((solve(*(open(0).read().splitlines()))))
# Original solution
# coding: utf-8


def solve(*args: str) -> str:
    n, m, k = list(map(int, args[0].split()))
    mod = 998244353

    if m == 1 and n-1 == k:
        return str(1)

    ncr = 1
    p = m*pow(m-1, n-1, mod) % mod
    ret = p
    inv = pow(m-1, mod-2, mod)
    for i in range(1, k+1):
        ncr = (ncr * (n-i)*pow(i, mod-2, mod)) % mod
        p = (p*inv) % mod
        ret += p*ncr % mod

    return str(ret % mod)


if __name__ == "__main__":
    print((solve(*(open(0).read().splitlines()))))


# Optimized solution
# coding: utf-8


def solve(*args: str) -> str:
    n, m, k = list(map(int, args[0].split()))
    mod = 998244353

    if m == 1 and n-1 == k:
        return str(1)

    ncr = 1
    p = m*pow(m-1, n-1, mod) % mod

    ret = p
    iR = [1]*(k+1)
    im = pow(m-1, mod-2, mod)

    for i in range(1, k+1):
        iR[i] = max(1, (-(mod//i) * iR[mod % i]) % mod)
        ncr = (ncr * (n-i)*iR[i]) % mod
        p = (p*im) % mod
        ret += p*ncr % mod

    return str(ret % mod)


if __name__ == "__main__":
    print((solve(*(open(0).read().splitlines()))))
# Original solution
def inv(a,m):
    b=m
    (x, lastx) = (0, 1)
    (y, lasty) = (1, 0)
    while b != 0:
        q = a // b
        (a, b) = (b, a % b)
        (x, lastx) = (lastx - q * x, x)
        (y, lasty) = (lasty - q * y, y)
    return lastx % m

mod=998244353
n,m,k=list(map(int,input().split()))
frac=[1 for i in range(n+1)]
frac_inv=[1 for i in range(n+1)]
beki=[m for i in range(n+1)]

for i in range(1,n+1):
    frac[i]=frac[i-1]*i%mod
    frac_inv[i]=inv(frac[i],mod)
    beki[i]=beki[i-1]*(m-1)%mod
ans=0
for i in range(n-k,n+1):
    ans+=beki[i-1]*frac[n-1]*frac_inv[n-i]*frac_inv[i-1]%mod
print((ans%mod))

# Optimized solution
def inv(a,m):
    b=m
    (x, lastx) = (0, 1)
    (y, lasty) = (1, 0)
    while b != 0:
        q = a // b
        (a, b) = (b, a % b)
        (x, lastx) = (lastx - q * x, x)
        (y, lasty) = (lasty - q * y, y)
    return lastx % m

mod=998244353
n,m,k=list(map(int,input().split()))
frac=[1 for i in range(n+1)]
frac_inv=[1 for i in range(n+1)]
beki=[m for i in range(n+1)]

for i in range(1,n+1):
    frac[i]=frac[i-1]*i%mod
    frac_inv[i]=inv(frac[i],mod)
    beki[i]=beki[i-1]*(m-1)%mod
ans=0
for i in range(n-k,n+1):
    ans+=beki[i-1]*frac[n-1]%mod*frac_inv[n-i]*frac_inv[i-1]%mod
print((ans%mod))
# Original solution
MOD=998244353
N,M,K=list(map(int,input().split()))

def powmod(a,p):
  if p==0:
    return 1
  else:
    pow2=powmod(a,p//2)
    if p%2==0:
      return (pow2**2)%MOD
    else:
      return (a*pow2**2)%MOD
def invmod(a):
  return powmod(a,MOD-2)

if M==1 and K<N-1:
  print((0))
else:
  ans=0
  term1=powmod(M-1,N-1)
  term2=1
  inv_M1=invmod(M-1)
  for i in range(K+1):
    ans+=term1*term2
    ans%=MOD
    term1=term1*inv_M1%MOD
    term2=term2*(N-i-1)*invmod(i+1)%MOD
    
  answer=M*ans%MOD
  print(answer)

# Optimized solution
MOD=998244353
N,M,K=list(map(int,input().split()))

inv_table = [0]+[1]
for i in range(2,K+2):
  inv_table.append(-(MOD//i)*inv_table[MOD%i]%MOD)

def powmod(a,p):
  if p==0:
    return 1
  else:
    pow2=powmod(a,p//2)
    if p%2==0:
      return (pow2**2)%MOD
    else:
      return (a*pow2**2)%MOD
def invmod(a):
  return powmod(a,MOD-2)

if M==1 and K<N-1:
  print((0))
elif K==N-1:
  print((powmod(M,N)))
else:
  ans=0
  term1=powmod(M-1,N-1)
  term2=1
  inv_M1=invmod(M-1)
  for i in range(K+1):
    ans+=term1*term2
    ans%=MOD
    term1=term1*inv_M1%MOD
    term2=term2*(N-i-1)*inv_table[i+1]%MOD
    
  answer=M*ans%MOD
  print(answer)
# Original solution
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  MAX = 998244353
  n, m, k = list(map(int, input().split()))
  
  def pow_mod_p(n, k, p):
    x = 1
    while k:
      if k % 2 == 1:
        x *= n
        x %= p
      n **= 2
      n %= p
      k >>= 1
    return x
  
  ncp = m * pow_mod_p(m-1, n-1, MAX)
  divm = pow_mod_p(m-1, MAX-2, MAX)
  cnt = ncp
  cmb = 1
  for ik in range(1, k+1):
    ncp *= divm
    ncp %= MAX
    
    cmb *= ((n-ik) * pow_mod_p(ik, MAX-2, MAX))
    cmb %= MAX
    
    cnt += ncp * cmb
    cnt %= MAX
    
  print((cnt % MAX))

if __name__=='__main__':
  main()



# Optimized solution
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  MAX = 998244353
  n, m, k = list(map(int, input().split()))
    
  cnt = 0
  cmb = 1
  for ik in range(k+1):
    ncp = m * pow(m-1, n-ik-1, MAX)
    ncp %= MAX
    
    if ik == 0:
      cmb = 1
    else:
      cmb *= ((n-ik) * pow(ik, MAX-2, MAX))
    cmb %= MAX
    
    cnt += ncp * cmb
    cnt %= MAX
    
  print((cnt % MAX))

if __name__=='__main__':
  main()