CodeEff/ECCO huggingface dataset:
# Original solution
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
n,m,k = list(map(int,readline().split()))
mod = 998244353
 
if m == 1:
    if k < n-1:
        print((0))
    else:
        print((1))
    exit()

def pow(n,p,mod=mod): #繰り返し二乗法(nのp乗)
    res = 1
    while p > 0:
        if p % 2 == 0:
            n = n ** 2 % mod
            p //= 2
        else:
            res = res * n % mod
            p -= 1
    return res % mod

def factrial_memo(n=2*10**5,mod=mod):
    fact = [1, 1]
    for i in range(2, n + 1):
        fact.append((fact[-1] * i) % mod)
    return fact
fact = factrial_memo()

def fermat_cmb(n, r, mod=mod): #needs pow,factrial_memo(only fact). return nCk
    return fact[n] * pow(fact[r],mod-2) * pow(fact[n-r],mod-2) %mod
ans = 0
for i in range(k+1):
    res = m*pow(m-1,n-1-i) #塊を含めて分けられるもの達
    ans += res*fermat_cmb(n-1,i)%mod
print((ans%mod))

# Optimized solution
#ABC167-E Colorful Blocks
"""
隣り合うブロックの組の個数がi個(i=0~k)であるときの組み合わせ数を求めていく。
まず、k=0の時を考えると、m=4の時、
res = 4*3**(n-1)となることがわかる。
次に、k>0のときは、
どれか2つのブロックを1つにつなぎ合わせると考えて、
res = 4*3**(n-1-i)
これに合わせて、どのブロックが接続するのかを考える必要があり、
どのブロックも右隣のブロックにのみ接続できると考えた場合、
接続できるブロックの個数はn-1個(一番右のブロックは接続先がない)
そこからi個選んで右のブロックにつなぐので、
n-1Ciとなる。
よって、k>0の場合の組み合わせ数は、
res = 4*3**(n-1-i)*(n-1)Ci
となる。
これを for i in range(0,k+1)だけ足し合わせたものが答え。
補足：
例えば3つのブロックを接続すると考えた場合、
2つをつなぎ合わせる場合と区別しそうだが、
「つなぐブロックの個数」はどちらでも同じになる。
更に、その時に全体の分割されたブロックの個数はn-i個で固定されるので、
m*pow(m-1,n-1-i)の部分が変わることもなく、
どの隣のブロックを選ぶかというのも隣接しても不都合がない。
"""
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
n,m,k = list(map(int,readline().split()))
mod = 998244353
 
if m == 1:
    if k < n-1:
        print((0))
    else:
        print((1))
    exit()

def pow(n,p,mod=mod): #繰り返し二乗法(nのp乗)
    res = 1
    while p > 0:
        if p % 2 == 0:
            n = n ** 2 % mod
            p //= 2
        else:
            res = res * n % mod
            p -= 1
    return res % mod

def factrial_memo(n=2*10**5,mod=mod):
    fact = [1, 1]
    for i in range(2, n + 1):
        fact.append((fact[-1] * i) % mod)
    return fact
fact = factrial_memo()

def fermat_cmb(n, r, mod=mod): #needs pow,factrial_memo(only fact). return nCk
    return fact[n] * pow(fact[r],mod-2) * pow(fact[n-r],mod-2) %mod
ans = 0
for i in range(k+1):
    res = m*pow(m-1,n-1-i) #塊を含めて分けられるもの達
    ans += res*fermat_cmb(n-1,i)%mod
print((ans%mod))
# Original solution
N, M, K = list(map(int, input().split()))
mod = 998244353

facs = [1]        
nfac = 1
for i in range(1, N):
    nfac = nfac * i %mod
    facs.append(nfac)

s = 0
for i in range(0, K+1):
    patterns = facs[N-1] * pow(facs[i], mod-2, mod) * pow(facs[N-1-i], mod-2, mod) % mod
    d = patterns * M * pow(M-1, N-1-i, mod) % mod
    s = (s + d) % mod

print((s % mod))

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

facs = [1] * (N + 1)
nfac = 1
for i in range(1, N):
    nfac = nfac * i %mod
    facs[i] = nfac

s = 0
for i in range(0, K+1):
    patterns = facs[N-1] * pow(facs[i], mod-2, mod) * pow(facs[N-1-i], mod-2, mod) % mod
    d = patterns * M * pow(M-1, N-1-i, mod) % mod
    s = (s + d) % mod

print(s)
# Original solution
#!/usr/bin/env python

def main():
    n, m, k = list(map(int, input().split()))
    div = 998244353

    ret = 0
    comb = 1
    x = m * ((m-1) ** (n-k-1))
    comb_list = [0] * (k+1)
    x_list = [0] * (k+1)
    comb_list[0] = comb
    x_list[0] = x
    for i in range(1, k+1):
        comb = comb * (n-i) // i
        x = x * (m-1) % div
        comb_list[i] = comb
        x_list[i] = x

    for i in range(k+1):
        ret += comb_list[i] * x_list[k-i] % div
        ret %= div

    print(ret)


if __name__ == '__main__':
    main()


# Optimized solution
#!/usr/bin/env python
def modpow(x, y, mod):
    ret = 1
    z = x
    n = len(bin(y)) - 2
    for i in range(n):
        if ((y >> i) & 1):
            ret = ret * z % mod
        z = z * z % mod
    return ret

def modinv(x, mod):
    return modpow(x, mod-2, mod)

def main():
    n, m, k = list(map(int, input().split()))
    mod = 998244353

    c1 = 1
    c2 = 1
    for i in range(1, n):
        c1 = c1 * i % mod
        if i == k:
            c2 = modinv(c1, mod)
    c3 = modinv(c1, mod)
    c3_list = [0] * (k+1)
    c3_list[k] = c3
    for i in range(k-1, -1, -1):
        c3 = c3 * (n-(k-i)) % mod
        c3_list[i] = c3
    comb = (c1 * c2 % mod) * c3_list[0] % mod

    x = m * modpow(m-1, n-k-1, mod) % mod

    ret = x * comb % mod

    for i in range(1, k+1):
        c2 =c2 * (k-i+1) % mod
        comb = (c1 * c2 % mod) * c3_list[i] % mod
        x = x * (m-1) % mod

        ret += x * comb % mod
        ret %= mod

    print(ret)


if __name__ == '__main__':
    main()
# Original solution
n, m, k = list(map(int, input().split()))
MOD = 998244353


def power(n, k, mod):
    if k == 0:
        return 1
    elif k % 2 == 1:
        return (n * power(n, k - 1, mod)) % mod
    else:
        return power((n ** 2) % mod, k // 2, mod)


lp = [1]  # (m - 1) ** i
p = 1
for i in range(n - 1):
    p = (p * (m - 1)) % MOD
    lp.append(p)


lf = [1]  # i!
f = 1
for i in range(n - 1):
    f = (f * (i + 1)) % MOD
    lf.append(f)

fn = lf[-1]

answer = 0

for i, f, fr, p in zip(list(range(k + 1)), lf, reversed(lf), reversed(lp)):
    # d = (lf[i] * lf[n - 1 - i]) % MOD
    d = (f * fr) % MOD
    dinv = power(d, MOD - 2, MOD)
    c = (fn * dinv) % MOD
    # n_pattern = (c * m * lp[n - 1 - i]) % MOD
    n_pattern = (c * m * p) % MOD

    answer = (answer + n_pattern) % MOD


print(answer)






# Optimized solution
n, m, k = list(map(int, input().split()))
MOD = 998244353


class Combination:
    def __init__(self, n, mod):
        self.n = n
        self.mod = mod

        self.f = self._get_f()
        self.fi = self._get_fi()

    def __call__(self, k):
        if not 0 <= k <= self.n:
            return 0
        else:
            num = self.f[self.n]
            deninv = (self.fi[k] * self.fi[self.n - k]) % self.mod
            return (num * deninv) % self.mod

    def _get_f(self):
        f = 1
        lf = [1]

        for i in range(1, self.n + 1):
            f = (f * i) % self.mod
            lf.append(f)

        return lf

    def _get_fi(self):
        ii = 1
        lii = [0, 1]  # [i^-1 modulo mod for i in 0, ..., n]
        fi = 1
        lfi = [1, 1]

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

            fi = (fi * ii) % self.mod
            lfi.append(fi)

        return lfi


c = Combination(n - 1, MOD)


def n_pattern(i):
    result = m
    result *= c(i)
    result %= MOD
    result *= pow(m - 1, n - i - 1, MOD)
    result %= MOD
    return result


answer = sum(n_pattern(i) for i in range(k + 1)) % MOD
print(answer)
# Original solution
N, M, K = list(map(int, input().split()))
MOD = 998244353

CONV = [1]
ans = 0

for i in range(1, N):
  CONV.append(CONV[-1] * (N-i) // i)

for k in range(K+1):
  # M x (N-1)Ck x (M-1) ^ (N - 1 - k)
  ans += (CONV[k] * pow(M-1, N-1-k, MOD)) % MOD
  
print((ans * M % MOD))

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

ans = 0

class combination():
    def __init__(self, n):
        self.fact = [1] * (n+1)
        self.ifact = [1] * (n+1)
        for i in range(1, n+1):
            self.fact[i] = self.fact[i-1]*i % MOD
        self.ifact[n] = pow(self.fact[n], MOD-2, MOD)
        for i in range(n, 0, -1):
            self.ifact[i-1] = self.ifact[i]*i % MOD
    def comb(self, n, k):
        if k < 0 or k > n: return 0
        comb = self.fact[n]*self.ifact[k]*self.ifact[n-k] %MOD
        return comb
comb = combination(N)

  
for k in range(K+1):
  # M x (N-1)Ck x (M-1) ^ (N - 1 - k)
  ans += (comb.comb(N-1, k) * pow(M-1, N-1-k, MOD)) % MOD
  
print((ans * M % MOD))
# Original solution
n,m,k=list(map(int,open(0).read().split()))
mod=998244353
c=[1]*(k+1)
for i in range(1,k+1):
  c[i]=c[i-1]*(n-i)//i
ans=0
for i in range(k+1):
  ans+=m*pow(m-1,n-1-i,mod)*(c[i]%mod)
  ans%=mod
print(ans)

# Optimized solution
n,m,k=list(map(int,open(0).read().split()))
p=998244353
'''
c=[1]*(k+1)
for i in range(1,k+1):
  c[i]=c[i-1]*(n-i)//i
  c[i-1]%=mod
'''
def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 998244353
N = n  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用
 
for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)
ans=0
for i in range(k+1):
  ans+=m*pow(m-1,n-1-i,p)*cmb(n-1,i, p)
  ans%=p
print(ans)
# Original solution
import sys

input=sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()


def II(): return int(eval(input()))


def MI(): return list(map(int,input().split()))


def MF(): return list(map(float,input().split()))


def LI(): return list(map(int,input().split()))


def LF(): return list(map(float,input().split()))


def TI(): return tuple(map(int,input().split()))


# rstrip().decode('utf-8')

def main():
	n,m,k=MI()
	mod=998244353
	
	f=[1]
	for i in range(1,2*10**5+100):
		f.append((f[-1]*i)%mod)
	finv=[]
	for i in f:
		finv.append(pow(i,mod-2,mod))
	
	mp=[1]
	for i in range(1,2*10**5+100):
		mp.append((mp[-1]*(m-1))%mod)
		
	
	ans=0
	for kk in range(k+1):
		cnt=f[n-1]*finv[kk]*finv[n-1-kk]
		cnt%=mod
		cnt*=m*mp[n-kk-1]
		cnt%=mod
		ans+=cnt
	print((ans%mod))













if __name__=="__main__":
	main()


# Optimized solution
import sys

input=sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()


def II(): return int(eval(input()))


def MI(): return list(map(int,input().split()))


def MF(): return list(map(float,input().split()))


def LI(): return list(map(int,input().split()))


def LF(): return list(map(float,input().split()))


def TI(): return tuple(map(int,input().split()))


# rstrip().decode('utf-8')

def main():
	n,m,k=MI()
	mod=998244353
	
	f=[1]
	for i in range(1,2*10**5+100):
		f.append((f[-1]*i)%mod)
	finv=[]
	for i in f:
		finv.append(pow(i,mod-2,mod))
	
	mp=[1]
	for i in range(1,2*10**5+100):
		mp.append((mp[-1]*(m-1))%mod)
		
	
	ans=0
	for kk in range(k+1):
		cnt=f[n-1]*finv[kk]*finv[n-1-kk]*m*mp[n-kk-1]
		ans+=cnt
		ans%mod
	print((ans%mod))













if __name__=="__main__":
	main()
# Original solution
mod = 998244353


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

power_cache = {}
power_cache[(M-1, 0)] = 1
for i in range(N-1):
    power_cache[(M-1, i+1)] = (power_cache[(M-1, i)]*(M-1)) % mod


def power(x, y):
    return power_cache[(x, y)]


combination_cache = {}
combination_cache[(N-1, 0)] = 1
for i in range(0, K+1):
    i_plus_inverse = pow(i+1, mod-2, mod)
    combination_cache[(N-1, i+1)] = (combination_cache[(N-1, i)
                                                       ]*(N-1-i)*i_plus_inverse) % mod


def combination(n, r):
    return combination_cache[(n, r)]


ans = 0
for i in range(0, K+1):
    ans += M*combination(N-1, i)*power(M-1, N-1-i)
    ans %= mod

print(ans)


# Optimized solution
mod = 998244353


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


invs = {}


def inv(n):
    if n not in invs:
        invs[n] = pow(n, mod-2, mod)
    return invs[n]


powers = {(M-1, N-1): pow(M-1, N-1, mod)}


def power(x, y):
    if y == 0:
        return 1
    if (x, y) not in powers:
        powers[(x, y)] = powers[(x, y+1)] * inv(x)
        powers[(x, y)] %= mod
    return powers[(x, y)]


ans = 0
comb = 1
for i in range(K+1):
    now = M*power(M-1, N-1-i)*comb
    now %= mod
    ans += now
    ans %= mod
    comb *= ((N-i-1)*inv(i+1))
    comb %= mod

print(ans)
# Original solution
n,m,k = list(map(int, input().split()))

# ---------------------------------------
# nCr(n, r, m) テンプレ
mod = 998244353

fac = [1,1] # 階乗 n!
inv = [0,1] # 逆元 1/n
finv = [1,1] # 逆元の階乗 (n^-1)! = (1/n)!

for i in range(2, n+1):
    fac.append( (fac[-1] * i ) % mod )
    inv.append( (-inv[mod%i] * (mod//i)) % mod )
    finv.append( (finv[-1] * inv[-1]) % mod )

def nCr(n, r, m):
    if (n<0 or r<0 or n<r): return 0
    r = min(r, n-r)
    return fac[n] * finv[n-r] * finv[r] % m
# ----------------------------

ans = 0
colors = m
for p in range(n-1, -1, -1):
    if p <= k:
        groups = nCr(n-1, p, mod)
        ans += groups * colors % mod
        ans %= mod
    colors *= m - 1
    colors %= mod
ans += mod
ans %= mod
print(ans)


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

# ---------------------------------------
# nCr(n, r, m) テンプレ
mod = 998244353

fac = [1,1] # 階乗 n!
inv = [0,1] # 逆元 1/n
finv = [1,1] # 逆元の階乗 (n^-1)! = (1/n)!

for i in range(2, n+1):
    fac.append( (fac[-1] * i ) % mod )
    inv.append( (-inv[mod%i] * (mod//i)) % mod )
    finv.append( (finv[-1] * inv[-1]) % mod )

def nCr(n, r, m):
    if (n<0 or r<0 or n<r): return 0
    r = min(r, n-r)
    return fac[n] * finv[n-r] * finv[r] % m
# ----------------------------

ans = 0
colors = m
for p in range(n-1, -1, -1):
    if p <= k:
        ans += colors * nCr(n-1, p, mod) % mod
    colors *= m - 1
    colors %= mod
ans %= mod
print(ans)
# Original solution
n, m, k = list(map(int, input().split()))
mod = 998244353

N = 10**6  # N!まで求める
fact  = [1, 1]  # 階乗の元テーブル
fact_inv = [1, 1]  # 階乗の逆元テーブル
inv = [0, 1]  # 逆元テーブル計算用テーブル 1,2,,...の逆元を求めてる

# 計算 O(1)
def comb(n, r, mod):
    if (r<0 or r>n):
        return 0
    r = min(r, n-r)
    return fact[n] * fact_inv[r] * fact_inv[n-r] % mod

# 順列
def perm(n, r, mod):
    if (r<0 or r>n):
        return 0
    return fact[n] *  fact_inv[n-r] % mod

# 前処理 O(n)
for i in range(2, N + 1):
    fact.append((fact[-1] * i) % mod)
    inv.append((-inv[mod % i] * (mod//i)) % mod)
    fact_inv.append((fact_inv[-1] * inv[-1]) % mod)

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

print(ans)

# Optimized solution
n, m, k = list(map(int, input().split()))
mod = 998244353

N = 10**5 * 2  # N!まで求める
fact  = [1, 1]  # 階乗の元テーブル
fact_inv = [1, 1]  # 階乗の逆元テーブル
inv = [0, 1]  # 逆元テーブル計算用テーブル 1,2,,...の逆元を求めてる

# 計算 O(1)
def comb(n, r, mod):
    if (r<0 or r>n):
        return 0
    r = min(r, n-r)
    return fact[n] * fact_inv[r] * fact_inv[n-r] % mod

# 順列
def perm(n, r, mod):
    if (r<0 or r>n):
        return 0
    return fact[n] *  fact_inv[n-r] % mod

# 前処理 O(n)
for i in range(2, N + 1):
    fact.append((fact[-1] * i) % mod)
    inv.append((-inv[mod % i] * (mod//i)) % mod)
    fact_inv.append((fact_inv[-1] * inv[-1]) % mod)

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

print(ans)
# Original solution
mod = 998244353

class mod_combination:
    def __init__(self, N):
        self.fac = [1] * (N + 1)
        for i in range(1, N + 1):
            self.fac[i] = (self.fac[i - 1] * i) % mod
        self.invmod = [1] * (N + 1)
        self.invmod[N] = pow(self.fac[N], mod - 2, mod)
        for i in range(N, 0, -1):
            self.invmod[i - 1] = (self.invmod[i] * i) % mod
        
    def calc(self, n, k): # nCk
        return self.fac[n] * self.invmod[k] % mod * self.invmod[n - k] % mod


n, m, k = list(map(int, input().split()))
C = mod_combination(n)
ans = 0
color = m
for x in reversed(list(range(n))):
    if x <= k:
        ans += C.calc(n - 1, n - x - 1) * color % mod
        ans %= mod
    color *= m - 1
print(ans)


# Optimized solution
mod = 998244353

class mod_combination:
    def __init__(self, N):
        self.fac = [1] * (N + 1)
        for i in range(1, N + 1):
            self.fac[i] = (self.fac[i - 1] * i) % mod
        self.invmod = [1] * (N + 1)
        self.invmod[N] = pow(self.fac[N], mod - 2, mod)
        for i in range(N, 0, -1):
            self.invmod[i - 1] = (self.invmod[i] * i) % mod
        
    def calc(self, n, k): # nCk
        return self.fac[n] * self.invmod[k] % mod * self.invmod[n - k] % mod


n, m, k = list(map(int, input().split()))
C = mod_combination(n)
ans = 0
for x in range(k + 1):
    ans = (ans + C.calc(n - 1, n - x - 1) * m * pow(m - 1, n - x - 1, mod) % mod) % mod
print(ans)
# Original solution
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
inp = sys.stdin.buffer.readline

def resolve():
    # nCk = n! / n!(n-k)! のテーブル作成
    def COMinit(n, MOD):
        fact = [1, 1]
        fact_inv = [1, 1]
        inv = [0, 1]
        for i in range(2, n + 1):
            fact.append((fact[-1] * i) % MOD)
            inv.append((-inv[MOD % i] * (MOD // i)) % MOD)
            fact_inv.append((fact_inv[-1] * inv[i]) % MOD)
        return fact, fact_inv
 
    # 二項係数計算
    def Combination(n, k, MOD=998244353):
        # fac, finv = COMinit(n, MOD)
        if n < k: return 0
        if n < 0 or k < 0: return 0
        ret = fac[n] * (finv[k] * finv[n - k] % MOD) % MOD
        return ret
 
    MOD = 998244353
    N, M, K = list(map(int, inp().split()))
 
    # テーブルを作成し、K回使いまわす
    fac, finv = COMinit(N-1, MOD)
 
    ans = 0
    for k in range(K+1):
        cmb = Combination(N-1, k)
        m_pow = pow(M-1, (N-k-1), MOD)
        ans += M * m_pow * cmb
        ans %= MOD
 
    print(ans)
  
if __name__ == "__main__":
    resolve()

# Optimized solution

def resolve():
    # nCk = n! / n!(n-k)! のテーブル作成
    def COMinit(n, MOD):
        fact = [1, 1]
        fact_inv = [1, 1]
        inv = [0, 1]
        for i in range(2, n + 1):
            fact.append((fact[-1] * i) % MOD)
            inv.append((-inv[MOD % i] * (MOD // i)) % MOD)
            fact_inv.append((fact_inv[-1] * inv[i]) % MOD)
        return fact, fact_inv

    # 二項係数計算
    def Combination(n, k, MOD=998244353):
        # fac, finv = COMinit(n, MOD)
        if n < k: return 0
        if n < 0 or k < 0: return 0
        ret = fac[n] * (finv[k] * finv[n - k] % MOD) % MOD
        return ret

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

    # テーブルを作成し、K回使いまわす
    fac, finv = COMinit(N-1, MOD)
    m_mod = [1]
    for _ in range(N):
        m_mod.append(m_mod[-1] * (M - 1) % MOD)

    ans = 0
    for k in range(K+1):
        cmb = Combination(N-1, k)
        ans += (M%MOD) * (m_mod[N-k-1]%MOD) * cmb
        ans %= MOD

    print(ans)

if __name__ == "__main__":
    resolve()
# Original solution
import sys
input = sys.stdin.readline

mod = 998244353

n, m, k = [int(x) for x in input().split()]

def make_tables(n, mod = 998244353):
    fac = [1, 1] # 階乗テーブル
    finv = [1, 1] #逆元の階乗テーブル
    inv = [0, 1] #逆元テーブル

    for i in range(2, n + 1):
        fac.append((fac[-1] * i) % mod)
        inv.append((mod -inv[mod % i] * (mod // i)) % mod)
        finv.append((finv[-1] * inv[-1]) % mod)
    return fac, finv

def nCk(n, k, mod = 998244353):
    k = min(k, n-k)
    return fac[n] * finv[k] * finv[n-k] % mod

fac, finv = make_tables(n)
cal = m
ans = 0
for i in range(n - 1 - k):
    cal *= m - 1
    cal %= mod
ans += cal * nCk(n - 1, k)
ans %= mod
for i in range(1, k + 1):
    cal *= (m - 1)
    ans += cal * nCk(n - 1, k - i)
    ans %= mod
print(ans)


# Optimized solution
import sys
input = sys.stdin.readline

mod = 998244353

n, m, k = [int(x) for x in input().split()]

def make_tables(n, mod = 998244353):
    fac = [1, 1] # 階乗テーブル
    finv = [1, 1] #逆元の階乗テーブル
    inv = [0, 1] #逆元テーブル

    for i in range(2, n + 1):
        fac.append((fac[-1] * i) % mod)
        inv.append((mod -inv[mod % i] * (mod // i)) % mod)
        finv.append((finv[-1] * inv[-1]) % mod)
    return fac, finv

def nCk(n, k, mod = 998244353):
    k = min(k, n-k)
    return fac[n] * finv[k] * finv[n-k] % mod

fac, finv = make_tables(n)
cal = m
ans = 0
for i in range(n - 1 - k):
    cal *= m - 1
    cal %= mod
ans += cal * nCk(n - 1, k)
ans %= mod
for i in range(1, k + 1):
    cal *= (m - 1)
    cal %= mod
    ans += cal * nCk(n - 1, k - i)
    ans %= mod
print(ans)
# Original solution
import math

N ,M, K = list(map(int,input().split()))
MOD = 998244353
SUM = 0

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
invs = getInvs(K+3, MOD)

POW = [1]
for i in range(1,N):
    a = (POW[-1] * (M-1))%MOD
    POW.append(a)

mole = 1
deno = 1
for i in range(K+1):
    SUM += M * POW[N-1-i]%MOD * mole % MOD * deno % MOD
    SUM %= MOD
    mole *= (N-1-i)
    mole %= MOD
    deno *= invs[i+1]

print(SUM)

# Optimized solution
import math

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

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
invs = getInvs(N+3, MOD)

num = M
nums = []
for i in reversed(list(range(1,N))):
    nums.append(num)
    num *= i*(M-1)
    num *= invs[N-i]
    num %= MOD
nums.append(num)
nums.reverse()

ans = sum(nums[:K+1])
ans %= MOD
print(ans)
# Original solution
# -*- coding: utf-8 -*-
import sys
N,M,K=list(map(int, sys.stdin.readline().split()))
mod=998244353

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

def ncr(n,r):
	if n<0 or r<0 or n<r:	return 0
	else:   return (fact[n]*inv_fact[r]*inv_fact[n-r])%mod

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

# Optimized solution
import sys
N,M,K=list(map(int, sys.stdin.readline().split()))
mod=998244353

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

def ncr(n,r):
	if n<0 or r<0 or n<r:	return 0
	else:   return (fact[n]*inv_fact[r]*inv_fact[n-r])%mod

ans=0
for k in range(K+1):
    ans+=ncr(N-1,k)*M*pow(M-1,N-1-k,mod)
    ans%=mod
print(ans)
# Original solution
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 998244353
def input(): return sys.stdin.readline()[:-1]
def pri(x): print(('\n'.join(map(str, x))))

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

fact = [1]
for i in range(1, N+10):
    fact.append(fact[-1] * i % MOD)
def rev(x):
    return pow(x, MOD-2, MOD)
def cmb(i, k):
    if(i < k): return 0
    return fact[i] * rev(fact[k]) * rev(fact[i-k]) % MOD

def count(m, k):
    combo = cmb(N-1, k)
    col = m * pow(m-1, N-k-1, MOD)
    val = (combo*col)%MOD
    return val

cnt = 0
for k in range(0, K+1):
    addval = count(M, k)
    cnt += addval
    cnt %= MOD

print(cnt)


# Optimized solution
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 998244353
def input(): return sys.stdin.readline()[:-1]
def pri(x): print(('\n'.join(map(str, x))))

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

    fact = [1]
    for i in range(1, N+3):
        fact.append(fact[-1] * i % MOD)
    def rev(x):
        return pow(x, MOD-2, MOD)
    def cmb(i, k):
        if(i < k): return 0
        return fact[i] * rev(fact[k]) * rev(fact[i-k]) % MOD

    def count(m, k):
        combo = cmb(N-1, k)
        col = m * pow(m-1, N-k-1, MOD)
        val = (combo*col)%MOD
        return val

    cnt = 0
    for k in range(0, K+1):
        addval = count(M, k)
        cnt += addval
        cnt %= MOD

    print(cnt)
if __name__=='__main__':
    main()