There are N blocks arranged in a row. Let us paint these blocks.
We will consider two ways to paint the blocks different if and only if there is a block painted in different colors in those two ways.
Find the number of ways to paint the blocks under the following conditions:
 - For each block, use one of the M colors, Color 1 through Color M, to paint it. It is not mandatory to use all the colors.
 - There may be at most K pairs of adjacent blocks that are painted in the same color.
Since the count may be enormous, print it modulo 998244353.

-----Constraints-----
 - All values in input are integers.
 - 1 \leq N, M \leq 2 \times 10^5
 - 0 \leq K \leq N - 1

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

-----Output-----
Print the answer.

-----Sample Input-----
3 2 1

-----Sample Output-----
6

The following ways to paint the blocks satisfy the conditions: 112, 121, 122, 211, 212, and 221. Here, digits represent the colors of the blocks.

Difficulty: MEDIUM

Solutions:
mod = 998244353
(N, M, K) = map(int, input().split())
f = 1
f_list = [1]
for m in range(1, N + 1):
	f *= m
	f %= mod
	f_list.append(f)
inv = pow(f, mod - 2, mod)
inv_list = [1] * (N + 1)
inv_list[N] = inv
for m in range(N, 1, -1):
	inv *= m
	inv %= mod
	inv_list[m - 1] = inv
ans = 0
for i in range(K + 1):
	color = pow(M - 1, N - 1 - i, mod)
	order = f_list[N - 1] * inv_list[i] * inv_list[N - i - 1] % mod
	ans += color * order * M % mod
	ans = ans % mod
print(ans % mod)


(N, M, K) = map(int, input().split())
MOD = 998244353
fact = [1]
rfact = [1]
for i in range(1, N + 1):
	fact.append(fact[i - 1] * i % MOD)
	rfact.append(pow(fact[i], MOD - 2, MOD))

def C(n, m):
	return fact[n] * rfact[m] * rfact[n - m] % MOD
res = 0
for k in range(K + 1):
	res = (res + C(N - 1, k) * M * pow(M - 1, N - k - 1, MOD)) % MOD
print(res)


(n, m, k) = [int(x) for x in input().split()]
if m == 1:
	if k == n - 1:
		print(1)
	else:
		print(0)
	exit()
sumi = 0
mod = 998244353
prodi = pow(m - 1, n - 1, mod)
invi = pow(m - 1, mod - 2, mod)
for j in range(n - 1, n - 1 - k - 1, -1):
	sumi += prodi
	sumi %= mod
	prodi *= j
	prodi %= mod
	prodi *= pow(n - j, mod - 2, mod)
	prodi %= mod
	prodi *= invi
	prodi %= mod
sumi *= m
sumi %= mod
print(sumi)


def power_func(a, n, p):
	bi = str(format(n, 'b'))
	res = 1
	for i in range(len(bi)):
		res = res * res % p
		if bi[i] == '1':
			res = res * a % p
	return res
(n, m, k) = map(int, input().split())
w = 998244353
t = 0
c = 1
b = m * (m - 1) ** (n - 1) % w
g = power_func(m - 1, w - 2, w)
for i in range(k + 1):
	t += c * b
	t %= w
	if i < k:
		c *= n - 1 - i
		c *= power_func(i + 1, w - 2, w)
		c %= w
		b *= g
		b %= w
if m == 1 and k == n - 1:
	print(1)
else:
	print(t)


def mod_pow(a, n, mod):
	result = 1
	a_n = a
	while n > 0:
		if n & 1:
			result = result * a_n % mod
		a_n = a_n * a_n % mod
		n >>= 1
	return result

class ModCombination:

	def __init__(self, mod, n_max):
		self.mod = mod
		self.n_max = n_max
		self.facts = [1, 1]
		self.inverses = [None, 1]
		self.fact_inverses = [1, 1]
		for i in range(2, self.n_max + 1):
			self.facts.append(self.facts[i - 1] * i % self.mod)
			self.inverses.append(self.mod - self.inverses[self.mod % i] * (self.mod // i) % self.mod)
			self.fact_inverses.append(self.fact_inverses[i - 1] * self.inverses[i] % self.mod)

	def mod_combination(self, n, k):
		if k == 0:
			return 1
		if n == 0:
			return 0
		denominator = self.fact_inverses[k] * self.fact_inverses[n - k] % self.mod
		return self.facts[n] * denominator % self.mod
MOD = 998244353
(N, M, K) = list(map(int, input().split(' ')))
ans = 0
comb = ModCombination(mod=MOD, n_max=N)
for k in range(0, K + 1):
	ans += M * comb.mod_combination(N - 1, k) % MOD * mod_pow(M - 1, N - 1 - k, MOD)
	ans %= MOD
print(ans)


(n, m, k) = map(int, input().split())
mod = 998244353
s = m - 1
S = 1
ans = 0
fact = [1] * (n + 1)
fact_inv = [0] * (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)
fact_inv[0] = fact_inv[1]
for t in range(n):
	if t >= n - k - 1:
		b = fact[n - 1] * fact_inv[t] * fact_inv[n - t - 1]
		ans += S * b % mod
	S = S * s % mod
print(m * ans % mod)


(n, m, k) = map(int, input().split())
(fact, factinv, mod) = ([1] * n, [1] * n, 998244353)
for i in range(2, n):
	fact[i] = fact[i - 1] * i % mod
factinv[n - 1] = pow(fact[n - 1], mod - 2, mod)
for i in range(n - 2, 0, -1):
	factinv[i] = factinv[i + 1] * (i + 1) % mod
ncr = lambda n, r: fact[n] * factinv[r] % mod * factinv[n - r] % mod
ans = pow(m, n, mod)
for i in range(k + 1, n):
	ans += mod - m * pow(m - 1, n - i - 1, mod) * ncr(n - 1, i) % mod
print(ans % mod)


import sys
readline = sys.stdin.readline

def main():
	(N, M, K) = map(int, readline().split())
	p = 998244353
	cnt = 0
	c = 1
	for i in range(K + 1):
		cnt += c * M * pow(M - 1, N - 1 - i, p)
		cnt %= p
		c *= (N - i - 1) * pow(i + 1, p - 2, p)
		c %= p
	print(cnt)
main()


def main():
	MOD = 998244353
	if 'get_ipython' in globals():
		(n, m, k) = (60522, 114575, 7559)
	else:
		(n, m, k) = map(int, input().split())
	fac = [1] * (n + 1)
	inv = [1] * (n + 1)
	for i in range(n):
		fac[i + 1] = fac[i] * (i + 1) % MOD
		inv[i + 1] = pow(fac[i + 1], MOD - 2, MOD)

	def nCr(n, r):
		if 2 * r > n:
			nCr(n, n - r)
		return fac[n] * inv[r] * inv[n - r] % MOD
	ans = 0
	for i in range(k + 1):
		tmp = nCr(n - 1, i) * m * pow(m - 1, n - 1 - i, MOD)
		ans += tmp
		ans %= MOD
	print(ans)
main()


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


(N, M, K) = map(int, input().split())
mod = 998244353
factorial = [1 for i in range(N + 1)]
for i in range(1, N + 1):
	if i == 1:
		factorial[i] = 1
	else:
		factorial[i] = factorial[i - 1] * i % mod

def comb(n, k):
	return factorial[n] * pow(factorial[n - k] * factorial[k], -1, mod) % mod

def count(n, m, k):
	return m * comb(n - 1, k) * pow(m - 1, n - k - 1, mod) % mod
print(sum([count(N, M, i) for i in range(K + 1)]) % mod)


(n, m, k) = map(int, input().split())
mod = 998244353
fac = [1] * (n + 1)
per = [1] * (n + 1)
for i in range(1, n + 1):
	fac[i] = fac[i - 1] * i % mod
	per[i] = pow(fac[i], mod - 2, mod)

def nCk(n, k):
	return fac[n] * per[k] % mod * per[n - k] % mod
ans = 0
for i in range(k + 1):
	ans += m * pow(m - 1, n - 1 - i, mod) % mod * nCk(n - 1, i) % mod
	ans %= mod
print(ans)


import sys
l = sys.stdin.readline().strip()
(N, M, K) = map(int, l.split())
comb_quick = {}
mod = 998244353
C = [1]
for i in range(1, (N - 1) // 2 + 2):
	next = C[-1] * (N - i) * pow(i, mod - 2, mod)
	C.append(next % mod)
res = 0
for x in range(K + 1):
	crt = pow(M - 1, N - x - 1, mod) * M % mod
	crt %= mod
	idx = min(x, N - 1 - x)
	crt *= C[idx]
	crt %= mod
	res += crt
	res %= mod
print(res)


class Factorial:

	def __init__(self, mod=10 ** 9 + 7):
		self.mod = mod
		self._factorial = [1]
		self._size = 1
		self._factorial_inv = [1]
		self._size_inv = 1

	def __call__(self, n):
		return self.fact(n)

	def fact(self, n):
		if n >= self.mod:
			return 0
		self._make(n)
		return self._factorial[n]

	def _make(self, n):
		if n >= self.mod:
			n = self.mod
		if self._size < n + 1:
			for i in range(self._size, n + 1):
				self._factorial.append(self._factorial[i - 1] * i % self.mod)
			self._size = n + 1

	def fact_inv(self, n):
		if n >= self.mod:
			raise ValueError('Modinv is not exist! arg={}'.format(n))
		if self._size_inv < n + 1:
			self._factorial_inv += [-1] * (n + 1 - self._size_inv)
			self._size_inv = n + 1
		if self._factorial_inv[n] == -1:
			self._factorial_inv[n] = self.modinv(self.fact(n))
		return self._factorial_inv[n]

	def _make_inv(self, n, r=2):
		if n >= self.mod:
			n = self.mod - 1
		if self._size_inv < n + 1:
			self._factorial_inv += [-1] * (n + 1 - self._size_inv)
			self._size_inv = n + 1
		self._factorial_inv[n] = self.modinv(self.fact(n))
		for i in range(n, r, -1):
			self._factorial_inv[i - 1] = self._factorial_inv[i] * i % self.mod

	@staticmethod
	def xgcd(a, b):
		(x0, x1, y0, y1) = (0, 1, 1, 0)
		while a != 0:
			((q, a), b) = (divmod(b, a), a)
			(y0, y1) = (y1, y0 - q * y1)
			(x0, x1) = (x1, x0 - q * x1)
		return (b, x0, y0)

	def modinv(self, n):
		(g, x, _) = self.xgcd(n, self.mod)
		if g != 1:
			raise ValueError('Modinv is not exist! arg={}'.format(n))
		return x % self.mod

	def comb(self, n, r):
		if r > n:
			return 0
		t = self(n) * self.fact_inv(n - r) % self.mod
		return t * self.fact_inv(r) % self.mod

	def comb_(self, n, r):
		c = 1
		for i in range(1, r + 1):
			c *= (n - i + 1) * self.fact_inv(i)
			c %= self.mod
		return c

	def comb_with_repetition(self, n, r):
		t = self(n + r - 1) * self.fact_inv(n - 1) % self.mod
		return t * self.fact_inv(r) % self.mod

	def perm(self, n, r):
		if r > n:
			return 0
		return self(n) * self.fact_inv(n - r) % self.mod
(n, m, k) = map(int, input().split())
mod = 998244353
f = Factorial(mod)
f._make_inv(n - 1)
comb = f.comb
s = 0
for i in range(k + 1, n):
	t = comb(n - 1, i) * m % mod
	t = t * pow(m - 1, n - 1 - i, mod) % mod
	s = (s + t) % mod
ans = (pow(m, n, mod) - s) % mod
print(ans)


(N, M, K) = map(int, input().split())
MOD = 998244353
fac = [1 for i in range(N + 1)]
for n in range(1, N + 1):
	fac[n] = n * fac[n - 1] % MOD
fac_inv = [1 for i in range(n + 1)]
fac_inv[N] = pow(fac[N], MOD - 2, MOD)
for n in range(N - 1, -1, -1):
	fac_inv[n] = fac_inv[n + 1] * (n + 1) % MOD

def C(n, k):
	global MOD
	return fac[n] * fac_inv[k] * fac_inv[n - k] % MOD
print(sum([C(N - 1, b) * M * pow(M - 1, N - 1 - b, MOD) % MOD for b in range(K + 1)]) % MOD)


(N, M, K) = list(map(int, input().split()))
MOD = 998244353
if M == 1:
	print(1 if K == N - 1 else 0)
	return
MAXN = N + 5
fac = [1, 1] + [0] * MAXN
finv = [1, 1] + [0] * MAXN
inv = [0, 1] + [0] * MAXN
for i in range(2, MAXN + 2):
	fac[i] = fac[i - 1] * i % MOD
	inv[i] = -inv[MOD % i] * (MOD // i) % MOD
	finv[i] = finv[i - 1] * inv[i] % MOD

def comb(n, r):
	if n < r:
		return 0
	if n < 0 or r < 0:
		return 0
	return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD
cs = []
ms = [M * pow(M - 1, N - 1 - K, MOD) % MOD]
for i in range(K + 1):
	cs.append(comb(N - 1, i))
	if i:
		ms.append(ms[-1] * (M - 1) % MOD)
ans = 0
for (c, m) in zip(cs, ms[::-1]):
	ans += c * m
print(ans % MOD)


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)


import sys
readline = sys.stdin.readline
MOD = 998244353
(N, M, K) = 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)


(n, m, k) = map(int, input().split())
mod = 998244353
nCi = [1]
for i in range(n):
	next = nCi[i] * (n - 1 - i) * pow(i + 1, mod - 2, mod)
	next %= mod
	nCi.append(next)
ans = 0
for i in range(k + 1):
	ans += m * pow(m - 1, n - i - 1, mod) * nCi[i]
	ans %= mod
print(ans)


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

def comb(x, y):
	if y < 0 or y > x:
		return 0
	return fact[x] * ifact[x - y] * ifact[y] % mod
mm = [1]
for _ in range(n + 1):
	mm.append(mm[-1] * (m - 1) % mod)
ans = 0
for i in range(k + 1):
	ans += m * comb(n - 1, i) * mm[n - 1 - i]
	ans %= mod
print(ans)


(n, m, k) = map(int, input().split())
factorials = []
current = 1
for i in range(n):
	factorials.append(current)
	current = (i + 1) * current % 998244353
inverselist = []
for i in range(n):
	inverselist.append(pow(factorials[i], 998244351, 998244353))
ans = 0
for i in range(0, k + 1):
	ans = (ans + m * pow(m - 1, n - i - 1, 998244353) * factorials[n - 1] * inverselist[i] * inverselist[n - 1 - i]) % 998244353
print(ans)


mod = 998244353
(n, m, k) = map(int, input().split(' '))
F = [1 for i in range(n + 1)]
for i in range(1, n + 1):
	F[i] = F[i - 1] * i % mod
I = [1 for i in range(n + 1)]
for i in range(2, n + 1):
	I[i] = (mod - int(mod / i)) * I[mod % i] % mod
for i in range(2, n + 1):
	I[i] = I[i] * I[i - 1] % mod

def binom(n, k):
	return F[n] * I[k] % mod * I[n - k] % mod
pw = [1 for i in range(n + 1)]
for i in range(1, n + 1):
	pw[i] = pw[i - 1] * (m - 1) % mod
ans = 0
for i in range(k + 1):
	sz = n - i
	ans += binom(n - 1, i) * m % mod * pw[sz - 1] % mod
	ans %= mod
print(ans)


MOD = 998244353
(N, M, K) = map(int, input().split())
ans = 0
NCi = 1
for i in range(0, K + 1, 1):
	ans = (ans + M * pow(M - 1, N - 1 - i, MOD) * NCi) % MOD
	NCi = NCi * (N - 1 - i) * pow(i + 1, MOD - 2, MOD) % MOD
print(ans)


(n, m, k) = map(int, input().split())
mod = 998244353
res = 0
pat = 1
for i in range(0, k + 1):
	res += pat * pow(m - 1, n - 1 - i, mod)
	pat *= (n - 1 - i) * pow(i + 1, mod - 2, mod)
	pat %= mod
print(m * res % mod)


(n, m, k) = map(int, input().split())
mod = 998244353
f = [1] * (n + 1)
revf = [1] * (n + 1)
for i in range(2, n + 1):
	f[i] = f[i - 1] * i % mod
revf[n] = pow(f[n], mod - 2, mod)
for i in range(n - 1, 0, -1):
	revf[i] = revf[i + 1] * (i + 1) % mod

def C(x, y):
	return f[x] * revf[y] * revf[x - y] % mod
ans = 0
for i in range(k + 1):
	ans += m * pow(m - 1, n - i - 1, mod) * C(n - 1, i)
	ans %= mod
print(ans)


def main():
	(n, m, k) = map(int, input().split())
	mod = 998244353
	comb = 1
	c = 0
	for i in range(k + 1):
		if i > 0:
			comb = comb * (n - i) * pow(i, mod - 2, mod) % mod
		c = (c + m * comb * pow(m - 1, n - 1 - i, mod)) % mod
	print(c)
main()


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

def comb(n, k, mod):
	return fact[n] * finv[k] * finv[n - k] % mod
for i in range(0, k + 1):
	ans += m * pow(m - 1, n - i - 1, mod) * comb(n - 1, i, mod)
	ans %= mod
print(ans)


(N, M, K) = map(int, input().split())
mod = 998244353
inv = [0, 1]
for i in range(2, N):
	inv.append(-inv[mod % i] * (mod // i) % mod)
if N == 1:
	print(M)
	return
m = [1]
s = 1
for _ in range(N - 1):
	s = s * (M - 1) % mod
	m.append(s)
ncombi = [1]
c = 1
for k in range(K):
	c = c * (N - 1 - k) * inv[k + 1]
	c %= mod
	ncombi.append(c)
ans = 0
for k in range(K + 1):
	ans = ans + m[-k - 1] * ncombi[k]
	ans %= mod
ans = ans * M % mod
print(ans)


import sys, math, itertools
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
MOD = 998244353

def I():
	return int(input())

def F():
	return float(input())

def S():
	return input()

def LI():
	return [int(x) for x in input().split()]

def LI_():
	return [int(x) - 1 for x in input().split()]

def LF():
	return [float(x) for x in input().split()]

def LS():
	return input().split()

def factorialMod(n, p):
	fact = [0] * (n + 1)
	fact[0] = fact[1] = 1
	factinv = [0] * (n + 1)
	factinv[0] = factinv[1] = 1
	inv = [0] * (n + 1)
	inv[1] = 1
	for i in range(2, n + 1):
		fact[i] = fact[i - 1] * i % p
		inv[i] = -inv[p % i] * (p // i) % p
		factinv[i] = factinv[i - 1] * inv[i] % p
	return (fact, factinv)

def combMod(n, r, fact, factinv, p):
	if r < 0 or n < r:
		return 0
	r = min(r, n - r)
	return fact[n] * factinv[r] * factinv[n - r] % p

def resolve():
	(N, M, K) = LI()
	ans = 0
	(fact, factinv) = factorialMod(N, MOD)
	for i in range(K + 1):
		ans += combMod(N - 1, i, fact, factinv, MOD) * M * pow(M - 1, N - 1 - i, MOD)
		ans %= MOD
	print(ans)

def __starting_point():
	resolve()
__starting_point()


(n, m, k) = map(int, input().split())
(mod1, mod2) = (10 ** 9 + 7, 998244353)
mod = mod2
MAX = n - 1
fact = [1] * (MAX + 1)
inv = [1] * (MAX + 1)
for i in range(2, MAX + 1):
	fact[i] = i * fact[i - 1] % mod
inv[-1] = pow(fact[-1], mod - 2, mod)
for i in range(MAX, 1, -1):
	inv[i - 1] = inv[i] * i % mod

def comb(x, y):
	return fact[x] * inv[y] % mod * inv[x - y] % mod if x >= y >= 0 else 0
ans = 0
cor = pow(m - 1, n - 1 - k, mod)
for i in range(k, -1, -1):
	ans = (ans + comb(n - 1, i) * cor) % mod
	cor = cor * (m - 1) % mod
print(m * ans % mod)


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


import math
from operator import mul
from functools import reduce
(n, m, k) = map(int, input().split())
mod = 998244353

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
fact = [1, 1]
factinv = [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)
	factinv.append(factinv[-1] * inv[-1] % mod)
ans = 0
for i in range(k + 1):
	ans += m * cmb(n - 1, i, mod) * pow(m - 1, n - 1 - i, mod) % mod
	ans %= mod
print(ans)


(N, M, K) = list(map(int, input().split()))
p = 998244353
comb = 1
res = 0
for n in range(K + 1):
	res = (res + comb * M * pow(M - 1, N - 1 - n, p)) % p
	comb = comb * (N - 1 - n) * pow(n + 1, p - 2, p) % p
print(res)


MOD = 998244353
(n, m, k) = map(int, input().split())
fact = [0 for _ in range(n)]
invfact = [0 for _ in range(n)]
fact[0] = 1
for i in range(1, n):
	fact[i] = fact[i - 1] * i % MOD
invfact[n - 1] = pow(fact[n - 1], MOD - 2, MOD)
for i in range(n - 2, -1, -1):
	invfact[i] = invfact[i + 1] * (i + 1) % MOD

def nCk(n, k):
	if k < 0 or n < k:
		return 0
	else:
		return fact[n] * invfact[k] * invfact[n - k] % MOD
ans = 0
for i in range(0, k + 1):
	ans += m * pow(m - 1, n - i - 1, MOD) * nCk(n - 1, i) % MOD
print(ans % MOD)


(N, M, K) = map(int, input().split(' '))
mod = 998244353
ans = 0
fac = [0] * (N + 1)
inv = [0] * (N + 1)
finv = [0] * (N + 1)
fac[0] = fac[1] = 1
finv[0] = finv[1] = 1
inv[1] = 1
for i in range(2, N + 1):
	fac[i] = fac[i - 1] * i % mod
	inv[i] = mod - inv[mod % i] * (mod // i) % mod
	finv[i] = finv[i - 1] * inv[i] % mod

def COM(n, k):
	return fac[n] * (finv[k] * finv[n - k] % mod) % mod
for i in range(K + 1):
	ans += M * pow(M - 1, N - 1 - i, mod) * COM(N - 1, i)
	ans %= mod
print(ans)


import math

def main():
	(N, M, K) = list(map(int, input().split()))
	MOD = 998244353
	fact = [1] * (N + 1)
	factinv = [1] * (N + 1)
	for i in range(1, N + 1):
		fact[i] = fact[i - 1] * i % MOD
		factinv[i] = pow(fact[i], MOD - 2, MOD)

	def comb(n, k):
		return fact[n] * factinv[k] * factinv[n - k] % MOD
	ans = 0
	for k in range(K + 1):
		ans += comb(N - 1, k) * M * pow(M - 1, N - k - 1, MOD) % MOD
	print(ans % MOD)
main()


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

	def cmb(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
	N = 10 ** 6
	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)
	s = 0
	for i in range(k + 1):
		s += cmb(n - 1, i, mod) * m * pow(m - 1, n - 1 - i, mod) % mod
	print(s % mod)

def __starting_point():
	main()
__starting_point()


(N, M, K) = map(int, input().split())
mod = 998244353
ans = 0
facts = [1 for i in range(N + 1)]
invs = [1 for i in range(N + 1)]

def inv(x):
	return pow(x, mod - 2, mod)
for i in range(1, N + 1):
	facts[i] = facts[i - 1] * i % mod
	invs[i] = inv(facts[i])

def comb(n, r):
	return facts[n] * invs[r] * invs[n - r] % mod
for i in range(K + 1):
	d = M * pow(M - 1, N - i - 1, mod) * comb(N - 1, i)
	ans = (ans + d % mod) % mod
print(ans)


MOD = 998244353
(N, M, K) = map(int, input().split())
fac = [1] * N
for i in range(1, N):
	fac[i] = fac[i - 1] * i % MOD
pow_mmm = [1] * N
for i in range(1, N):
	pow_mmm[i] = pow_mmm[i - 1] * (M - 1) % MOD
ans = 0
for i in range(K + 1):
	t = M * pow_mmm[N - 1 - i] % MOD
	comb = fac[N - 1] * pow(fac[N - 1 - i], MOD - 2, MOD) * pow(fac[i], MOD - 2, MOD) % MOD
	t = t * comb % MOD
	ans = (ans + t) % MOD
print(ans)


mod = 998244353
(n, m, k) = map(int, input().split())
fac = [1] * (n + 1)
inv = [1] * (n + 1)
for i in range(1, n + 1):
	fac[i] = fac[i - 1] * i % mod
inv[n] = pow(fac[n], mod - 2, mod)
for i in range(n, 0, -1):
	inv[i - 1] = inv[i] * i % mod

def nCr(n, r):
	if r < 1:
		return 1
	return fac[n] * inv[r] % mod * inv[n - r] % mod
ans = 0
for i in range(k + 1):
	tmp = m * pow(m - 1, n - i - 1, mod) * nCr(n - 1, i) % mod
	ans = (ans + tmp) % mod
print(ans)


import sys
import math
import collections
import bisect
import itertools
import fractions
import copy
import heapq
import decimal
import queue
INF = 10 ** 16
MOD = 998244353

def ni():
	return int(sys.stdin.readline())

def ns():
	return list(map(int, sys.stdin.readline().split()))

def na():
	return list(map(int, sys.stdin.readline().split()))

class ModCombination:

	def __init__(self, maxN, MOD):
		self._maxN = maxN
		self._MOD = MOD
		self.facts = [1]
		self.invs = [1] * (self._maxN + 1)
		fact = 1
		for i in range(1, self._maxN + 1):
			fact *= i
			fact %= self._MOD
			self.facts.append(fact)
		inv = pow(fact, self._MOD - 2, self._MOD)
		self.invs[self._maxN] = inv
		for i in range(self._maxN, 1, -1):
			inv *= i
			inv %= self._MOD
			self.invs[i - 1] = inv

	def nCr(self, n, r):
		return self.facts[n] * self.invs[r] * self.invs[n - r] % self._MOD

def main():
	(n, m, k) = ns()
	mc = ModCombination(n, MOD)
	result = 0
	for ki in range(k + 1):
		ans = 1
		ans *= m % MOD
		ans *= pow(m - 1, n - 1 - ki, MOD)
		ans %= MOD
		ans *= mc.nCr(n - 1, ki)
		ans %= MOD
		result += ans
		result %= MOD
	print(result)

def __starting_point():
	main()
__starting_point()


(n, m, k) = map(int, input().split())
mod = 998244353
f = [0] * (n + 1)
p = [0] * (n + 1)
f[0] = 1
p[0] = 1
for i in range(1, n + 1):
	f[i] = f[i - 1] * i % mod
	p[i] = pow(f[i], mod - 2, mod)

def nCk(n, k):
	return f[n] * p[k] * p[n - k] % mod
ans = 0
for i in range(k + 1):
	if i == 0:
		ans += m * pow(m - 1, n - 1 - i, mod)
	else:
		ans += m * pow(m - 1, n - 1 - i, mod) * nCk(n - 1, i)
	ans %= mod
print(ans)


import sys
(N, M, K) = list(map(int, input().rstrip().split()))
if M == 1 and K == N - 1:
	print(1)
	return
elif M == 1 and K < N - 1:
	print(0)
	return
mod = 998244353
a = M * pow(M - 1, N - 1, mod)
inv_M1 = pow(M - 1, mod - 2, mod)
comb = 1
ans = 0
for i in range(K + 1):
	ans += comb * a
	ans %= mod
	a *= inv_M1
	a %= mod
	inv_i1 = pow(i + 1, mod - 2, mod)
	comb *= (N - 1 - i) * inv_i1
	comb %= mod
print(ans)


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

def prepare(n):
	fact = [1, 1]
	factinv = [1, 1]
	inv = [0, 1]
	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)
	return (fact, factinv)

def cmb(n, r, p):
	if r < 0 or n < r:
		return 0
	return f[n] * v[r] * v[n - r] % p
(f, v) = prepare(n)
ans = 0
for i in range(k + 1):
	a = cmb(n - 1, i, p) * m * pow(m - 1, n - i - 1, p) % p
	ans += a
	ans %= p
print(ans)


(n, m, k) = map(int, input().split())
ans = 0
mod = 998244353
p = [0 for i in range(n)]
p[0] = 1
for i in range(n - 1):
	p[i + 1] = p[i] * (i + 2) % mod
p.append(1)
for i in range(k + 1):
	u = pow(m - 1, n - 1 - i, mod)
	s = p[n - 2] * pow(p[i - 1], mod - 2, mod) * pow(p[n - i - 2], mod - 2, mod)
	ans = (ans + m * u * s) % mod
print(ans)


(N, M, K) = map(int, input().split())
MOD = 998244353
ans = 0
fact = [1] * (N + 1)
factinv = [1] * (N + 1)
for i in range(N):
	fact[i + 1] = fact[i] * (i + 1) % MOD
	factinv[i + 1] = pow(fact[i + 1], MOD - 2, MOD)

def nCk(n, k):
	return fact[n] * factinv[n - k] * factinv[k] % MOD

def solve(k):
	r = M * pow(M - 1, N - 1 - k, MOD) * nCk(N - 1, k)
	return r
for k in range(K + 1):
	ans += solve(k)
	ans %= MOD
print(ans)


(N, M, K) = map(int, input().split())
MOD = 998244353
n = N
fac = [1] * (n + 1)
rev = [1] * (n + 1)
for i in range(1, n + 1):
	fac[i] = i * fac[i - 1] % MOD
	rev[i] = pow(fac[i], MOD - 2, MOD)
comb = lambda a, b: fac[a] * rev[a - b] * rev[b] % MOD
ans = 0
for i in range(K + 1):
	ans += comb(N - 1, N - 1 - i) * M * pow(M - 1, N - 1 - i, MOD)
	ans %= MOD
print(ans)


import numpy as np
(N, M, K) = [int(_) for _ in input().split()]
mod = 998244353

class Factorial:

	def __init__(self, max_fact, mod):
		f = [1] * (max_fact + 1)
		for idx in range(2, max_fact + 1):
			f[idx] = f[idx - 1] * idx
			f[idx] %= mod
		if mod > max_fact:
			fi = [pow(f[-1], mod - 2, mod)]
			for idx in range(max_fact, 0, -1):
				fi += [fi[-1] * idx % mod]
			fi = fi[::-1]
		else:
			fi = [pow(n, mod - 2, mod) for n in f]
		self.mod = mod
		self.f = f
		self.fi = fi

	def factorial(self, n):
		return self.f[n]

	def factorial_inverse(self, n):
		return self.fi[n]

	def combination(self, n, r):
		f = self.f
		fi = self.fi
		return f[n] * fi[r] * fi[n - r] % self.mod

	def permutation(self, n, r):
		return self.f[n] * self.fi[n - r] % self.mod

	def homogeneous_product(self, n, r):
		f = self.f
		fi = self.fi
		return f[n + r - 1] * fi[r] * fi[n - 1] % self.mod
max_fact = N
fact_instance = Factorial(max_fact, mod)
comb = fact_instance.combination
ans = 0
for r in range(K + 1):
	ans += comb(N - 1, r) * M * pow(M - 1, N - r - 1, mod)
	ans %= mod
print(ans)


C = 998244353
(N, M, K) = map(int, input().split())
U = max(N + 1, K)
F = [0] * U
G = [0] * U
F[0] = 1
for i in range(1, U):
	F[i] = F[i - 1] * i % C
G[i] = pow(F[-1], C - 2, C)
for j in range(U - 2, -1, -1):
	G[j] = G[j + 1] * (j + 1) % C

def nCr(n, r):
	if r < 0 or n < r:
		return 0
	else:
		return F[n] * G[r] * G[n - r]
S = 0
for k in range(0, K + 1):
	S = (S + M * pow(M - 1, N - k - 1, C) * nCr(N - 1, k)) % C
print(S % C)


(n, m, k) = map(int, input().split())
wari = 998244353
basum = 0
for i in range(k + 1):
	if i == 0:
		kumiawase = 1
	else:
		kumiawase = kumiawase * (n - i) * pow(i, wari - 2, wari)
		kumiawase %= wari
	basum += m * pow(m - 1, n - i - 1, wari) * kumiawase
	basum %= wari
print(basum)


def main():
	MAX = 998244353
	(n, m, k) = 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)
main()


from sys import stdin
input = stdin.readline
(N, M, K) = map(int, input().split())
mod = 998244353
C = [-1] * (N + 1)

def comb(n, r):
	if r > n - r:
		C[r] = C[n - r]
	if r == 0:
		C[0] = 1
	if C[r] != -1:
		return C[r]
	else:
		C[r] = comb(n, r - 1) * (n + 1 - r) * pow(r, mod - 2, mod)
		C[r] %= mod
		return C[r]
ans = 0
for i in range(K + 1):
	ans += M * pow(M - 1, N - 1 - i, mod) * comb(N - 1, i)
	ans %= mod
print(ans)


(n, m, k) = map(int, input().split())
MOD = 998244353
frac = [1] * (n + 1)
inv = [1] * (n + 1)
for i in range(1, n + 1):
	frac[i] = i * frac[i - 1] % MOD
inv[n] = pow(frac[n], MOD - 2, MOD)
for i in range(n - 1, 0, -1):
	inv[i] = inv[i + 1] * (i + 1) % MOD

def nCr(n, r):
	res = frac[n] * inv[n - r] % MOD
	res = res * inv[r] % MOD
	return res
ans = 0
for i in range(k + 1):
	num_pair_block = i + 1
	num_seg = n - i
	ans += m * pow(m - 1, num_seg - 1, MOD) * nCr(n - 1, i) % MOD
	ans %= MOD
print(ans)


(N, M, K) = map(int, input().split())
ans = 0
mod = 998244353

def modinv(a, mod=998244353):
	return pow(a, mod - 2, mod)
fac = [0] * (N + 1)
fac[0] = 1
fac[1] = 1
for i in range(2, N + 1):
	fac[i] = fac[i - 1] * i % mod

def combi(n, r, mod=998244353):
	return fac[n] * modinv(fac[r]) % mod * modinv(fac[n - r]) % mod
z = M * pow(M - 1, N - K - 1, mod) % mod
for k in range(K, -1, -1):
	c = z * combi(N - 1, k) % mod
	ans += c
	z = z * (M - 1) % mod
print(ans % mod)


(n, m, k) = map(int, input().split())
p = 998244353
(fct, inv) = ([1], [1])
for i in range(1, n):
	fct.append(fct[-1] * i % p)
	inv.append(inv[-1] * pow(i, p - 2, p) % p)
ans = 0
for i in range(k + 1):
	cmb = fct[n - 1] * inv[i] * inv[n - 1 - i]
	ans = (ans + cmb * m * pow(m - 1, n - 1 - i, p)) % p
print(ans)


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

def nCk(n, k):
	return fact[n] * factinv[n - k] * factinv[k] % MOD
ans = 0
for i in range(k + 1):
	ans += m * pow(m - 1, n - 1 - i, MOD) * nCk(n - 1, i) % MOD
print(ans % MOD)


def main():
	(n, m, k) = map(int, input().split())
	f = [1]
	p = 998244353
	for i in range(1, n):
		f.append(f[-1] * i % p)
	ans = 0

	def nCk(n, k):
		return f[n] * pow(f[n - k], p - 2, p) * pow(f[k], p - 2, p) % p
	for i in range(k + 1):
		ans += m * nCk(n - 1, i) * pow(m - 1, n - 1 - i, p) % p
	print(ans % p)

def __starting_point():
	main()
__starting_point()


class Combination:

	def __init__(self, max_n, _mod):
		self.mod = _mod
		self.fac = [0 for _ in range(max_n + 10)]
		self.finv = [0 for _ in range(max_n + 10)]
		self.inv = [0 for _ in range(max_n + 10)]
		(self.fac[0], self.fac[1]) = (1, 1)
		(self.finv[0], self.finv[1]) = (1, 1)
		self.inv[1] = 1
		for i in range(2, max_n + 10):
			self.fac[i] = self.fac[i - 1] * i % self.mod
			self.inv[i] = self.mod
			self.inv[i] -= self.inv[self.mod % i] * (self.mod // i) % self.mod
			self.finv[i] = self.finv[i - 1] * self.inv[i] % self.mod

	def mod_comb(self, n, k):
		if n < k or n < 0 or k < 0:
			return 0
		res = self.fac[n] * (self.finv[k] * self.finv[n - k] % self.mod)
		res %= self.mod
		return res

def main():
	mod = 998244353
	(N, M, K) = map(int, input().split())
	comb = Combination(N, mod)
	ans = 0
	for i in range(K + 1):
		add_v = M * pow(M - 1, N - i - 1, mod) % mod
		add_v = add_v * comb.mod_comb(N - 1, i) % mod
		ans = (ans + add_v) % mod
	print(ans)
main()


(N, M, K) = map(int, input().split())
MOD = 998244353
fact = [0] * (N + 1)
inv = [0] * (N + 1)
fact[0] = fact[1] = 1
inv[1] = 1
for i in range(2, N + 1):
	fact[i] = fact[i - 1] * i % MOD
	inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD

def main():
	if N == 1:
		print(M)
		return
	num = M
	nums = [M]
	for i in reversed(range(1, N)):
		num *= i * (M - 1)
		num *= inv[N - i]
		num %= MOD
		nums.append(num)
	nums.reverse()
	print(sum(nums[:K + 1]) % MOD)

def __starting_point():
	main()
__starting_point()


import sys
import math
import collections
import bisect
import itertools
import fractions
import copy
import heapq
import decimal
import queue
import numpy as np
sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 998244353
ni = lambda : int(sys.stdin.readline())
ns = lambda : list(map(int, sys.stdin.readline().split()))
na = lambda : list(map(int, sys.stdin.readline().split()))

def main():

	def fast_pow(num, kata, mod):
		if kata == 0:
			return 1
		res = 1
		while kata > 0:
			if kata & 1 == 1:
				res = res * num % mod
			num = num * num % mod
			kata >>= 1
		return res

	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)
	(n, m, k) = ns()
	(p, i) = prepare(n, MOD)
	result = 0
	for ki in range(k + 1):
		ans = 1
		ans *= m % MOD
		ans *= fast_pow(m - 1, n - 1 - ki, MOD)
		ans %= MOD
		ans *= p[n - 1] * i[ki] * i[n - 1 - ki]
		ans %= MOD
		result += ans
		result %= MOD
	print(result)

def __starting_point():
	main()
__starting_point()


(N, M, K) = map(int, input().split())
mod = 998244353
l_lis = [1]
r_lis = [1]
(l, r) = (1, 1)
for j in range(K + 1):
	l = l * (j + 1) % mod
	r = r * (N - j - 1) % mod
	l_lis.append(l)
	r_lis.append(r)

def comb(a, b):
	global mod
	l = l_lis[b]
	r = r_lis[b]
	return r * pow(l, mod - 2, mod) % mod
ans = 0
for i in range(K + 1):
	ans += comb(N - 1, i) * M * pow(M - 1, N - 1 - i, mod) % mod
print(ans % mod)


M = 998244353
(n, m, k) = map(int, input().split())
k = n - k - 1
p = n - 1
F = [1]
for i in range(n + 1091):
	F.append(F[-1] * (i + 1) % M)

def C(k, n):
	return F[n] * pow(F[k] * F[n - k], M - 2, M)
ans = pow(m, n, M)
for x in range(k):
	ans -= C(x, p) * m * pow(m - 1, x, M)
	ans %= M
print(ans)


(N, M, K) = map(int, input().split())
MOD = 998244353
l = [0] * N
l[0] = 1
for i in range(1, N):
	l[i] = l[i - 1] * (M - 1)
	l[i] = l[i] % MOD
fact = [0] * N
fact[0] = 1
for i in range(1, N):
	fact[i] = fact[i - 1] * i % MOD
fact_inv = [0] * N
for i in range(N):
	fact_inv[i] = pow(fact[i], MOD - 2, MOD)
ans = 0
for i in range(K + 1):
	ans += M * l[N - 1 - i] % MOD * fact[N - 1] * fact_inv[i] % MOD * fact_inv[N - 1 - i] % MOD
	ans %= MOD
print(ans % MOD)


def combi(y, x, p=998244353):
	s = fac[y]
	t = fac[x]
	u = fac[y - x]
	ans = s * pow(t, p - 2, p) * pow(u, p - 2, p) % p
	return ans
(N, M, K) = map(int, input().split())
p = 998244353
fac = [1, 1]
for i in range(2, N + 1):
	fac.append(fac[-1] * i % p)
ans = 0
for i in range(0, K + 1):
	R = M % p * pow(M - 1, N - 1 - i, p) % p
	L = combi(N - 1, i)
	ans = (ans + R * L % p) % p
print(ans)


(n, m, k) = map(int, input().split())
mod = 998244353
ma = [1]
for i in range(1, k + 1):
	mad = ma[-1] * (n - i) * pow(i, mod - 2, mod)
	ma.append(mad)
	ma[-1] %= mod
ans = 0
for i in range(k + 1):
	ans += ma[i] * m * pow(m - 1, n - i - 1, mod)
	ans %= mod
print(ans)


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

def inv(a):
	return pow(a, MOD - 2, MOD)
fact = [0, 1]
for i in range(2, N + 1):
	fact.append(fact[-1] * i % MOD)

def choose(n, r):
	if r == 0 or r == n:
		return 1
	else:
		return fact[n] * inv(fact[r]) * inv(fact[n - r]) % MOD
exp = [1]
for i in range(1, N):
	exp.append(exp[-1] * (M - 1) % MOD)
ans = 0
for i in range(K + 1):
	ans += M * choose(N - 1, i) * exp[N - 1 - i] % MOD
	ans %= MOD
print(ans)


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

def inv(x, MOD):
	return pow(x, MOD - 2, MOD)
c = [0 for _ in range(n)]
c[0] = 1
for i in range(1, n):
	c[i] = c[i - 1] * (n - i)
	c[i] *= inv(i, MOD)
	c[i] %= MOD
ans = sum([m * c[i] * pow(m - 1, n - 1 - i, MOD) for i in range(k + 1)]) % MOD
print(ans)


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

def cmb(n, r, mod):
	if r < 0 or n < r:
		return 0
	r = min(r, n - r)
	return fact[n] * factinv[r] * factinv[n - r] % mod
mod = 998244353
N = 3 * 10 ** 5
fact = [1, 1]
factinv = [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)
	factinv.append(factinv[-1] * inv[-1] % mod)
ans = 0
for i in range(min(n, k + 1)):
	ans = (ans + cmb(n - 1, i, mod) * m * pow(m - 1, n - i - 1, mod)) % mod
print(ans)


(N, M, K) = map(int, input().split())
mod = 998244353
f = [1]
for i in range(1, N + 1):
	f.append(f[-1] * i % mod)

def comb(n, r):
	return f[n] * (pow(f[r], mod - 2, mod) * pow(f[n - r], mod - 2, mod) % mod) % mod
ans = 0
for i in range(K + 1):
	k = M * pow(M - 1, N - 1 - i, mod) % mod * comb(N - 1, i)
	k %= mod
	ans += k
	ans %= mod
print(ans)


(N, M, K) = map(int, input().split())
mod = 998244353
b = str(bin(mod - 2))[2:]
blis = []
for _ in range(len(b)):
	if b[-_ - 1] == '1':
		blis.append(_)

def modinv(a):
	if a == 1:
		return 1
	else:
		res = 1
		n = len(b)
		li = []
		for _ in range(n):
			li.append(a % mod)
			a = a * a % mod
		for item in blis:
			res = res * li[item] % mod
		return res
if N == 1:
	print(M)
	return
m = [1]
s = 1
for _ in range(N - 1):
	s = s * (M - 1) % mod
	m.append(s)
ncombi = [1]
c = 1
for k in range(K):
	c = c * (N - 1 - k) * modinv(k + 1)
	c %= mod
	ncombi.append(c)
ans = 0
for k in range(K + 1):
	ans = ans + m[-k - 1] * ncombi[k]
	ans %= mod
ans = ans * M % mod
print(ans)


import sys
sys.setrecursionlimit(10 ** 9)
mod = 998244353
memo = [-1] * 10 ** 6
memo[0] = 1

def fact(n):
	if memo[n] != -1:
		return memo[n]
	else:
		res = n * fact(n - 1) % mod
		memo[n] = res
		return res

def comb(n, k):
	return fact(n) * pow(fact(k), mod - 2, mod) * pow(fact(n - k), mod - 2, mod) % mod
(N, M, K) = map(int, input().split())
ans = 0
for k in range(K + 1):
	ans += M * pow(M - 1, N - k - 1, mod) * comb(N - 1, k)
	ans %= mod
print(ans)


(N, M, K) = map(int, input().split())
p = 998244353
factorial = [1]
counter = 0
for i in range(1, N + 1):
	factorial.append(factorial[i - 1] * i % p)
for k in range(K + 1):
	counter += factorial[N - 1] * pow(factorial[k], p - 2, p) * pow(factorial[N - k - 1], p - 2, p) * M * pow(M - 1, N - 1 - k, p)
print(counter % p)


MOD = 998244353
(n, m, k) = map(int, input().split())
c = 1
cnt = 0
for x in range(k + 1):
	cnt += c * m * pow(m - 1, n - 1 - x, MOD)
	cnt %= MOD
	c *= (n - x - 1) * pow(x + 1, MOD - 2, MOD)
	c %= MOD
print(cnt)


(n, m, k) = map(int, input().split())
mod = 998244353
if m == 1:
	print(0 if k != n - 1 else 1)
	exit()
fact = [1] * (n - 1 + 1)
inv = [1] * (n - 1 + 1)
for i in range(2, n - 1 + 1):
	fact[i] = i * fact[i - 1] % mod
inv[-1] = pow(fact[-1], mod - 2, mod)
for i in range(n - 1, 1, -1):
	inv[i - 1] = inv[i] * i % mod

def comb(x, y):
	return fact[x] * inv[y] % mod * inv[x - y] % mod
ans = 0
po = pow(m - 1, n - 1, mod) * m % mod
ue = fact[n - 1]
iii = pow(m - 1, mod - 2, mod) % mod
for i in range(k + 1):
	ans += comb(n - 1, i) * po % mod
	po *= iii
	po %= mod
print(ans % mod)


(n, m, k) = map(int, input().split())
mod = 998244353
MAX_N = n + 5
fac = [1, 1] + [0] * MAX_N
finv = [1, 1] + [0] * MAX_N
inv = [0, 1] + [0] * MAX_N
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

def nCk(n, k):
	if n < k:
		return 0
	if n < 0 or k < 0:
		return 0
	return fac[n] * (finv[k] * finv[n - k] % mod) % mod
ans = 0
for i in range(k + 1):
	ans += nCk(n - 1, i) * m * pow(m - 1, n - i - 1, mod)
	ans %= mod
print(ans)


class Combination:

	def __init__(self, n, mod):
		self.fact = [1]
		for i in range(1, n + 1):
			self.fact.append(self.fact[-1] * i % mod)
		self.inv_fact = [0] * (n + 1)
		self.inv_fact[n] = pow(self.fact[n], mod - 2, mod)
		for i in reversed(list(range(n))):
			self.inv_fact[i] = self.inv_fact[i + 1] * (i + 1) % mod
		self.mod = mod

	def factorial(self, k):
		return self.fact[k]

	def inverse_factorial(self, k):
		return self.inv_fact[k]

	def permutation(self, k, r):
		if k < r:
			return 0
		return self.fact[k] * self.inv_fact[k - r] % self.mod

	def combination(self, k, r):
		if k < r:
			return 0
		return self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r] % self.mod

	def combination_large(self, k, r):
		if k < r:
			return 0
		res = 1
		for l in range(r):
			res *= k - l
			res %= self.mod
		return res * self.inv_fact[r] % self.mod
(n, m, k) = list(map(int, input().split()))
mod = 998244353
cmb = Combination(10 ** 6, mod)
ans = 0
for i in range(k + 1):
	ans += m * cmb.combination(n - 1, i) * pow(m - 1, n - 1 - i, mod)
	ans %= mod
print(ans)


MOD = 998244353
(N, M, K) = map(int, input().split())
combination_N_1_ = [1]
for k in range(1, K + 1):
	tmp = combination_N_1_[-1] * (N - k) * pow(k, MOD - 2, MOD)
	tmp %= MOD
	combination_N_1_.append(tmp)
counter = 0
for i in range(K + 1):
	counter += pow(M - 1, N - i - 1, MOD) * M * combination_N_1_[i]
	counter %= MOD
print(counter)


def combs_mod(n, k, mod):
	inv = [1] * (k + 1)
	for i in range(1, k + 1):
		inv[i] = pow(i, mod - 2, mod)
	ans = [1] * (k + 1)
	for i in range(1, k + 1):
		ans[i] = ans[i - 1] * (n + 1 - i) * inv[i] % mod
	return ans

def solve():
	ans = 0
	mod = 998244353
	(N, M, K) = map(int, input().split())
	lis = combs_mod(N - 1, K, mod)
	for i in range(K + 1):
		ans += M * lis[i] * pow(M - 1, N - 1 - i, mod)
		ans %= mod
	return ans
print(solve())


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


(N, M, K) = map(int, input().split())
fac = [1]
mod = 998244353
for i in range(1, N + 1):
	fac.append(fac[i - 1] * i % mod)
ifac = [None] * (N + 1)
ifac[-1] = pow(fac[N], mod - 2, mod)
for i in range(N, 0, -1):
	ifac[i - 1] = ifac[i] * i % mod
ans = 0
for k in range(K + 1):
	t = M * fac[N - 1] % mod
	t = t * ifac[N - 1 - k] % mod
	t = t * ifac[k] % mod
	t = t * pow(M - 1, N - 1 - k, mod)
	t %= mod
	ans = (ans + t) % mod
print(ans)


(N, M, K) = map(int, input().split())
mod = 998244353
facs = [1] * N
invs = [1] * N
nfac = 1
for i in range(1, N):
	nfac = nfac * i % mod
	facs[i] = nfac
	invs[i] = pow(facs[i], mod - 2, mod)
s = 0
for i in range(K + 1):
	d = facs[N - 1] * invs[i] * invs[N - 1 - i] * M * pow(M - 1, N - 1 - i, mod) % mod
	s = (s + d) % mod
print(s)


(n, m, k) = map(int, input().split())
mod = 998244353
ans = 0
x = 1
for i in range(k + 1):
	ans += m * pow(m - 1, n - i - 1, mod) % mod * x % mod
	ans %= mod
	x = x * (n - i - 1) * pow(i + 1, mod - 2, mod) % mod
print(ans % mod)


import sys
sys.setrecursionlimit(10 ** 8)
MOD = 998244353
(N, M, K) = map(int, input().split())
inv_M = pow(M - 1, -1, MOD) if M > 1 else 0
ans = 0
tmp = pow(M - 1, N - 1, MOD) if M > 1 else 0
comb = 1
for i in range(K + 1):
	ans = (ans + M * comb * tmp) % MOD
	if i == K:
		break
	tmp = tmp * inv_M % MOD
	comb = comb * (N - 1 - i) * pow(i + 1, -1, MOD) % MOD
if M == 1 and K == N - 1:
	ans += 1
print(ans)


(N, M, K) = map(int, input().split())
mod = 998244353
fact = [1] * (N + 1)
fact_inv = [1] * (N + 1)
for i in range(1, N + 1):
	fact[i] = i * fact[i - 1] % mod
fact_inv[N] = pow(fact[N], mod - 2, mod)
for i in range(1, N + 1)[::-1]:
	fact_inv[i - 1] = i * fact_inv[i] % mod
comb = lambda n, k: fact[n] * fact_inv[k] * fact_inv[n - k] % mod
ans = 0
for i in range(K + 1):
	ans = (ans + comb(N - 1, i) * M * pow(M - 1, N - 1 - i, mod)) % mod
print(ans)


(N, M, K) = map(int, input().split())
out = 0
mod = 998244353
c = 1
for k in range(K + 1):
	out += M * pow(M - 1, N - k - 1, mod) * c
	out %= mod
	c *= (N - k - 1) * pow(k + 1, mod - 2, mod)
	c %= mod
print(out)


(N, M, K) = map(int, input().split())
mod = 998244353
fact = [1 for i in range(N + 1)]
for i in range(1, N):
	fact[i + 1] = fact[i] * (i + 1) % mod

def nCk(n, k):
	return fact[n] * pow(fact[n - k] * fact[k], mod - 2, mod)
result = 0
for k in range(K + 1):
	result += nCk(N - 1, k) * M * pow(M - 1, N - k - 1, mod)
	result = int(result) % mod
print(result)


import sys
readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
	(n, m, k) = list(map(int, readline().split()))
	MM = 998244353
	ans = 0
	com = 1
	for i in range(k + 1):
		l = n - i
		x = pow(m - 1, l - 1, MM)
		ans += m * x * com
		ans %= MM
		com *= n - (i + 1)
		com *= pow(i + 1, MM - 2, MM)
		com %= MM
	print(ans)
main()


mod = 998244353
(n, m, k) = map(int, input().split())
fcl = [1] * (n + 1)
for i in range(1, n + 1):
	fcl[i] = fcl[i - 1] * i % mod

def comb(x, y, p):
	return fcl[x] * pow(fcl[y], p - 2, p) % p * pow(fcl[x - y], p - 2, p) % p
ans = 0
for i in range(k + 1):
	ans += m * pow(m - 1, n - 1 - i, mod) * comb(n - 1, i, mod)
	ans %= mod
print(ans)


(n, m, k) = map(int, input().split())
mod = 998244353
N = n
fac = [1] * (N + 3)
inv = [1] * (N + 3)
t = 1
for i in range(1, N + 3):
	t *= i
	t %= mod
	fac[i] = t
t = pow(fac[N + 2], mod - 2, mod)
for i in range(N + 2, 0, -1):
	inv[i] = t
	t *= i
	t %= mod

def comb(n, r):
	if r > n or r < 0:
		return 0
	return fac[n] * inv[n - r] * inv[r] % mod
ans = pow(m, n, mod)
for i in range(k + 1, n):
	ans -= comb(n - 1, i) * m * pow(m - 1, n - i - 1, mod) % mod
	ans %= mod
print(ans)


MOD = 998244353
(N, M, K) = map(int, input().split())
f = [1]
for i in range(N):
	f.append(f[i] * (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)
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)


(n, m, k) = map(int, input().split())
mod = 998244353
ans = 0
if m == 1:
	print(1 if k == n - 1 else 0)
	exit()
tmp = m * pow(m - 1, n - 1, mod)
m_inv = pow(m - 1, mod - 2, mod)
invs = [0] + [pow(i + 1, mod - 2, mod) for i in range(n)]
for i in range(1, k + 2):
	ans += tmp
	tmp *= m_inv
	if i < n:
		tmp *= n - i
		tmp *= invs[i]
	tmp %= mod
print(ans % mod)


(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]
		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)


mod = 998244353
(N, M, K) = map(int, input().split())
invs = {}

def inv(n):
	if n not in invs:
		invs[n] = pow(n, mod - 2, mod)
	return invs[n]
fact = [1] * (N + 1)
for i in range(1, N + 1):
	fact[i] = fact[i - 1] * i
	fact[i] %= mod

def comb(n, r):
	ret = fact[n] * inv(fact[r]) * inv(fact[n - r])
	return ret % mod
ans = 0
for i in range(K + 1):
	now = M * pow(M - 1, N - 1 - i, mod) * comb(N - 1, i)
	now %= mod
	ans += now
	ans %= mod
print(ans)


def fast_pow(x, n, MOD):
	res = 1
	while n:
		if n & 1:
			res = res * x % MOD
		x = x * x % MOD
		n >>= 1
	return res

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)
MOD = 998244353
(fact, fact_inv) = prepare(3 * 10 ** 5, MOD)
(n, m, k) = map(int, input().split())
dp = [0] * (n + 1)
ans = 0
for i in range(k + 1):
	color = fast_pow(m - 1, n - 1 - i, MOD)
	order = fact[n - 1] * fact_inv[i] % MOD * fact_inv[n - 1 - i] % MOD
	ans += m * color % MOD * order % MOD
	ans %= MOD
print(ans)


import sys
read = sys.stdin.read
readline = sys.stdin.readline

def cmb(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 make_table2(n, mod=10 ** 9 + 7):
	g1 = [0] * (n + 1)
	g1[0] = 1
	g1[1] = 1
	tmp = 1
	for i in range(2, n + 1):
		tmp = tmp * i % mod
		g1[i] = tmp
	g2 = [0] * (n + 1)
	g2[-1] = pow(g1[-1], mod - 2, mod)
	tmp = g2[-1]
	for i in range(n - 1, -1, -1):
		tmp = tmp * (i + 1) % mod
		g2[i] = tmp
	return (g1, g2)
(N, M, K) = list(map(int, read().split()))
mod = 998244353
(g1, g2) = make_table2(N, mod)
answer = 0
for i in range(K + 1):
	answer = (answer + cmb(N - 1, i, mod) * M * pow(M - 1, N - i - 1, mod)) % mod
print(answer)


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

def comb(n, r, mod):
	if r < 0 or n < r:
		return 0
	r = min(r, n - r)
	return fact[n] * factinv[r] * factinv[n - r] % mod
fact = [1, 1]
factinv = [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)
	factinv.append(factinv[-1] * inv[-1] % mod)
for i in range(k + 1):
	a = pow(m - 1, n - i - 1, mod)
	b = comb(n - 1, i, mod)
	ans += a * b % mod
ans *= m
print(ans % mod)


mod = 998244353

def comb(n, r):
	if n < r:
		return 0
	if n < 0 or r < 0:
		return 0
	return fa[n] * fi[r] % mod * fi[n - r] % mod
(n, m, k) = map(int, input().split())
fa = [1] * (n + 1)
fi = [1] * (n + 1)
for i in range(1, n + 1):
	fa[i] = fa[i - 1] * i % mod
	fi[i] = pow(fa[i], mod - 2, mod)
ans = 0
for i in range(k + 1):
	ans += pow(m - 1, n - i - 1, mod) % mod * comb(n - 1, i) * m % mod
	ans %= mod
print(ans)


(n, m, k) = list(map(int, input().split()))
fac = [1] * n
finv = [1] * n
inv = [1] * n
MOD = 998244353
for i in range(2, 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

def comb(n, k):
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD
ans = 0
for i in range(k + 1):
	ans += comb(n - 1, i) * m * pow(m - 1, n - i - 1, MOD) % MOD
	ans %= MOD
print(ans)


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

def comb(n, k):
	if n < k:
		return 0
	if n < 0 or k < 0:
		return 0
	return fac[n] * finv[k] % mod * finv[n - k] % mod
fac = [1] * (n + 1)
finv = [1] * (n + 1)
for i in range(1, n + 1):
	fac[i] = fac[i - 1] * i % mod
	finv[i] = pow(fac[i], mod - 2, mod)
p = [1] * (n + 1)
for i in range(1, n + 1):
	p[i] = p[i - 1] * (m - 1) % mod
ans = 0
for i in range(k + 1):
	ans += m * comb(n - 1, i) % mod * p[n - 1 - i] % mod
	ans %= mod
print(ans)


(N, M, K) = list(map(int, input().rstrip().split()))
fact = [0] * (N + 1)
fact_inv = [0] * (N + 1)
inv = [0] * (N + 1)
mod = 998244353
fact[0] = fact[1] = 1
fact_inv[0] = fact_inv[1] = 1
inv[1] = 1
for i in range(2, N + 1):
	fact[i] = fact[i - 1] * i % mod
	inv[i] = mod - inv[mod % i] * (mod // i) % mod
	fact_inv[i] = fact_inv[i - 1] * inv[i] % mod
pow_M1 = [0] * N
pow_M1[0] = 1
for i in range(1, N):
	pow_M1[i] = pow_M1[i - 1] * (M - 1) % mod
ans = 0
for i in range(K + 1):
	comb = fact[N - 1] * fact_inv[i] * fact_inv[N - 1 - i] % mod
	ans += comb * M * pow_M1[N - i - 1] % mod
	ans %= mod
print(ans)


(n, m, k) = map(int, input().split())
mod = 998244353
fac = [1 for _ in range(n + 1)]
fac_inv = [1 for _ in range(n + 1)]
memo = [1 for _ in range(n + 1)]
for i in range(n):
	fac[i + 1] = fac[i] * (i + 1) % mod
	fac_inv[i + 1] = pow(fac[i + 1], mod - 2, mod)
	memo[i + 1] = memo[i] * (m - 1) % mod
ans = 0
for i in range(0, k + 1):
	ans = (ans + m * memo[n - i - 1] * fac[n - 1] * fac_inv[i] * fac_inv[n - i - 1]) % mod
print(ans)


def main():
	mod = 998244353
	fact = [1, 1]
	for i in range(2, 400001):
		fact.append(fact[-1] * i % mod)

	def nCr(n, r):
		return pow(fact[n - r] * fact[r] % mod, mod - 2, mod) * fact[n] % mod
	(n, m, k) = map(int, input().split())
	ans = 0
	for i in range(k + 1):
		ans = (ans + m * pow(m - 1, n - i - 1, mod) * nCr(n - 1, n - i - 1)) % mod
	print(ans)
main()


p = 998244353
(N, M, K) = map(int, input().split())
ans = 0
cmb = 1
for k in range(K + 1):
	ans += M * pow(M - 1, N - k - 1, p) * cmb
	ans %= p
	cmb *= (N - 1 - k) * pow(k + 1, p - 2, p)
	cmb %= p
print(ans)


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

def genCombinationFunction(max_k, mod):
	modinv_table = [-1] * (max_k + 1)
	modinv_table[1] = 1
	for i in range(2, max_k + 1):
		modinv_table[i] = -modinv_table[mod % i] * (mod // i) % mod

	def binomial_coefficients(n, k):
		ans = 1
		for i in range(k):
			ans *= n - i
			ans *= modinv_table[i + 1]
			ans %= mod
		return ans
	return (binomial_coefficients, modinv_table)
(f, table) = genCombinationFunction(10 ** 6, mod)
ans = 0
C = 1
for i in range(K + 1):
	base = M * pow(M - 1, N - i - 1, mod)
	if i:
		C *= N - i
		C *= table[i]
		C %= mod
	ans += C * base
	ans %= mod
print(ans)


(n, m, k) = map(int, input().split())
ans = 0
mod = 998244353
f = [1]
for i in range(n):
	f += [f[-1] * (i + 1) % mod]

def comb(a, b):
	return f[a] * pow(f[b], mod - 2, mod) * pow(f[a - b], mod - 2, mod) % mod
for kk in range(k + 1):
	anss = m * pow(m - 1, n - 1 - kk, mod) % mod
	anss = anss * comb(n - 1, kk) % mod
	ans = (ans + anss) % mod
print(ans)


def main():
	MOD = 998244353
	if 'get_ipython' in globals():
		(n, m, k) = (60522, 114575, 7559)
	else:
		(n, m, k) = map(int, input().split())
	(ans, N, K) = (0, 1, 1)
	for i in range(k + 1):
		ans += N * pow(K, MOD - 2, MOD) * pow(m - 1, n - 1 - i, MOD)
		ans %= MOD
		N *= n - 1 - i
		N %= MOD
		K *= i + 1
		K %= MOD
	ans *= m
	ans %= MOD
	print(ans)
main()


class CombMod:

	def __init__(self, V, mod):
		self.fact = [1] * V
		self.finv = [1] * V
		for i in range(1, V):
			self.fact[i] = self.fact[i - 1] * i % mod
		self.finv[-1] = pow(self.fact[-1], mod - 2, mod)
		for i in range(V - 2, 0, -1):
			self.finv[i] = self.finv[i + 1] * (i + 1) % mod
		self.mod = mod

	def comb(self, a, b):
		return self.fact[a] * self.finv[b] % mod * self.finv[a - b] % mod
(N, M, K) = list(map(int, input().split()))
mod = 998244353
tool = CombMod(N + 1, mod)
ans = 0
for k in range(K + 1):
	val = M * tool.comb(N - 1, k) % mod * pow(M - 1, N - 1 - k, mod) % mod
	ans = (ans + val) % mod
print(ans)


(N, M, K) = map(int, input().split())
if M == 1:
	print(1 if K == N - 1 else 0)
	exit()
mod = 998244353
f = [0] * N
f[0] = p = 1
for i in range(1, N):
	f[i] = p = p * i % mod
finv = [0] * N
finv[N - 1] = p = pow(f[N - 1], mod - 2, mod)
for i in range(N - 2, -1, -1):
	finv[i] = p = p * (i + 1) % mod
ans = 0
for k in range(K + 1):
	x = M * pow(M - 1, N - k - 1, mod) % mod
	y = f[N - 1] * finv[N - 1 - k] % mod * finv[k] % mod
	ans = (ans + x * y % mod) % mod
print(ans)


mod = 998244353
(n, m, k) = map(int, input().split())
mm1 = []
div = [0]
conv = [1]
p = 1
d = 1
for i in range(n):
	mm1.append(p)
	p = p * (m - 1) % mod
	div.append(pow(i + 1, mod - 2, mod))
	conv.append(conv[-1] * (n - i - 1) * div[-1] % mod)
ans = 0
for i in range(k + 1):
	a = m * mm1[n - i - 1] * conv[i]
	ans += a % mod
	ans %= mod
print(ans)


(N, M, K) = 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)
ans = 0
for k in range(K + 1):
	x = M * pow(M - 1, N - 1 - k, mod) * fact[N - 1] * fact_inv[k] * fact_inv[N - 1 - k]
	ans += x % mod
	ans = ans % mod
print(ans)


(n, m, k) = map(int, input().split())
MOD = 998244353
FAC = [1]
INV = [1]
for i in range(1, n + 1):
	FAC.append(FAC[i - 1] * i % MOD)
	INV.append(pow(FAC[-1], MOD - 2, MOD))

def nCr(n, r):
	return FAC[n] * INV[n - r] * INV[r]
ans = 0
for i in range(k + 1):
	ans += nCr(n - 1, i) * m * pow(m - 1, n - i - 1, MOD)
	ans %= MOD
print(ans)


from sys import stdin
readline = stdin.readline
(N, M, K) = map(int, readline().split())
mod = 998244353
fact = [1] * (N + 1)
finv = [1] * (N + 1)
inv = [1] * (N + 1)
inv[0] = 0
for i in range(2, N + 1):
	fact[i] = fact[i - 1] * i % mod
	inv[i] = -inv[mod % i] * (mod // i) % mod
	finv[i] = finv[i - 1] * inv[i] % mod

def com(N, K, mod):
	if K < 0 or N < K:
		return 0
	return fact[N] * finv[K] * finv[N - K] % mod
ans = 0
for x in range(K + 1):
	ans += com(N - 1, x, mod) * M * pow(M - 1, N - x - 1, mod)
	ans %= mod
print(ans)


(N, M, K) = map(int, input().split())
MOD = 998244353
ans = 0
(x, y) = (1, 1)
for k in range(K + 1):
	ans = ans + M * x * pow(y, MOD - 2, MOD) * pow(M - 1, N - 1 - k, MOD)
	ans = ans % MOD
	x = x * (N - k - 1)
	y = y * (k + 1)
	x = x % MOD
	y = y % MOD
print(ans % MOD)


class Combination:

	def __init__(self, N, MOD):
		self.mod = MOD
		self.FACT = [1, 1]
		self.INV = [0, 1]
		self.FACTINV = [1, 1]
		for i in range(2, N + 1):
			self.FACT.append(self.FACT[-1] * i % self.mod)
			self.INV.append(pow(i, self.mod - 2, self.mod))
			self.FACTINV.append(self.FACTINV[-1] * self.INV[-1] % self.mod)

	def calculate(self, N, R):
		if R < 0 or N < R:
			return 0
		R = min(R, N - R)
		return self.FACT[N] * self.FACTINV[R] * self.FACTINV[N - R] % self.mod
(n, m, k) = list(map(int, input().split()))
mod = 998244353
cmb = Combination(n, mod)
cnt = 0
for i in range(k + 1):
	cnt += m * pow(m - 1, n - i - 1, mod) * cmb.calculate(n - 1, i) % mod
print(cnt % mod)


import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 998244353

class CmbMod:

	def __init__(self, n, p):
		self.n = n
		self.p = p
		self.fact = [1, 1]
		self.factinv = [1, 1]
		self.inv = [0, 1]

	def cmb_mod(self, n, r):
		(numer, denom) = (1, 1)
		for i in range(r):
			numer = numer * (n - i) % self.p
			denom = denom * (i + 1) % self.p
		return numer * pow(denom, self.p - 2, self.p) % self.p

	def prep(self):
		for i in range(2, self.n + 1):
			self.fact.append(self.fact[-1] * i % self.p)
			self.inv.append(-self.inv[self.p % i] * (self.p // i) % self.p)
			self.factinv.append(self.factinv[-1] * self.inv[-1] % self.p)

	def cmb_mod_with_prep(self, n, r):
		if r < 0 or n < r:
			return 0
		r = min(r, n - r)
		return self.fact[n] * self.factinv[r] * self.factinv[n - r] % self.p

def resolve():
	(n, m, k) = list(map(int, input().split()))
	cmb = CmbMod(n, mod)
	cmb.prep()
	res = 0
	for i in range(k + 1):
		res += m * pow(m - 1, n - (i + 1), mod) * cmb.cmb_mod_with_prep(n - 1, i) % mod
		res %= mod
	print(res)

def __starting_point():
	resolve()
__starting_point()


def pre_c(n, mod):
	f = [0] * (n + 1)
	g = [0] * (n + 1)
	for i in range(n + 1):
		if i == 0:
			f[i] = 1
			g[i] = 1
		else:
			f[i] = f[i - 1] * i % mod
			g[i] = pow(f[i], mod - 2, mod)
	return (f, g)
(n, m, k) = map(int, input().split())
mod = 998244353
(F, G) = pre_c(n - 1, mod)
cnt = 0
for i in range(k + 1):
	temp = F[n - 1] * G[i] * G[n - 1 - i] * m * pow(m - 1, n - 1 - i, mod)
	cnt = (cnt + temp) % mod
print(cnt)


(n, m, k) = [int(t) for t in open(0).read().split()]
mod = 998244353
mem = [0] * max(k + 3, n + 1)
for i in range(k + 2):
	mem[i] = pow(m, i, mod)
c = 1
for i in range(k + 2, n + 1):
	mem[i] = (m * mem[i - 1] - m * c * pow(m - 1, i - k - 2, mod)) % mod
	c = c * (i - 1) * pow(i - k - 1, -1, mod) % mod
print(mem[n])


(N, M, K) = 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)


(N, M, K) = map(int, input().split())
mod = 998244353
fac = [1]
inv = [1]
for i in range(1, N + 10):
	fac.append(fac[-1] * i % mod)
	inv.append(pow(fac[-1], mod - 2, mod))

def comb(n, r):
	return fac[n] * inv[n - r] * inv[r] % mod
ret = 0
for k in range(K + 1):
	ret += comb(N - 1, k) * M * pow(M - 1, N - k - 1, mod) % mod
	ret %= mod
print(ret)


def cmb(n, r, p):
	return fac[n] * pow(fac[r], p - 2, p) * pow(fac[n - r], p - 2, p) % p
p = 998244353
(N, M, K) = map(int, input().split())
fac = [1] * (max(N, M) + 1)
for i in range(1, max(N, M) + 1):
	fac[i] = fac[i - 1] * i % p
ans = 0
for k in range(K + 1):
	ans += M * pow(M - 1, N - k - 1, p) * cmb(N - 1, k, p)
	ans %= p
print(ans)


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

def mod_comb(n, k, mod):
	return fact[n] * fact_inv[k] % mod * fact_inv[n - k] % mod
ans = 0
for i in range(k + 1):
	ans += m * pow(m - 1, n - 1 - i, mod) * mod_comb(n - 1, i, mod) % mod
ans %= mod
print(ans)


(N, M, K) = list(map(int, input().split()))
mod = 998244353
c = 1
answer = 0
for i in range(K + 1):
	answer += M * c * pow(M - 1, N - i - 1, mod) % mod
	answer %= mod
	c = c * (N - i - 1) * pow(i + 1, mod - 2, mod) % mod
print(answer)


mod = 998244353
(n, m, k) = map(int, input().split())
count = 0
comb = 1
for i in range(k + 1):
	tmp = comb * m * pow(m - 1, n - i - 1, mod) % mod
	count = (count + tmp) % mod
	comb = comb * (n - i - 1) * pow(i + 1, mod - 2, mod) % mod
print(count)


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

def perm(n, k):
	return fact[n] * rfact[n - k] % mod

def comb(n, k):
	return fact[n] * rfact[k] * rfact[n - k] % mod
paint = [0] * n
ans = 0
for i in range(n - k - 1, n):
	ans += comb(n - 1, i) * pow(m - 1, i, mod)
ans *= m
ans %= mod
print(ans)


(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)


mod = 998244353
(n, m, k) = map(int, input().split())
fac = [1]
for i in range(n):
	fac.append(fac[-1] * (i + 1) % mod)
ans = 0
for x in range(k + 1):
	rev = pow(fac[x] * fac[n - 1 - x] % mod, mod - 2, mod)
	r = fac[n - 1] * rev % mod * m * pow(m - 1, n - x - 1, mod) % mod
	ans += r
	ans %= mod
print(ans)


(N, M, K) = list(map(int, input().split()))
mod = 998244353
MAX = 510000
fac = [0] * MAX
facinv = [0] * MAX
inv = [0] * MAX

def modinv(a, mod):
	b = mod
	(x, u) = (1, 0)
	while b:
		q = a // b
		(a, b) = (b, a - q * b)
		(x, u) = (u, x - q * u)
	x %= mod
	return x

def mod_nCr_init(n, mod):
	fac[0] = fac[1] = 1
	facinv[0] = facinv[1] = 1
	inv[1] = 1
	for i in range(2, n):
		fac[i] = fac[i - 1] * i % mod
		inv[i] = -inv[mod % i] * (mod // i) % mod
		facinv[i] = facinv[i - 1] * inv[i] % mod

def mod_nCr(n, r, mod):
	if n < r or n < 0 or r < 0:
		return 0
	return fac[n] * (facinv[r] * facinv[n - r] % mod) % mod
mod_nCr_init(MAX, mod)
ans = 0
for i in range(K + 1):
	ans += mod_nCr(N - 1, i, mod) * M * pow(M - 1, N - i - 1, mod)
	ans %= mod
print(ans)


def solve():
	(N, M, K) = map(int, input().split())
	mod = 998244353
	dp = [1] * (K + 1)
	for i in range(1, K + 1):
		dp[i] = dp[i - 1] * (N - i) * pow(i, mod - 2, mod) % mod
	ans = 0
	for i in range(K + 1):
		ans += dp[i] * M * pow(M - 1, N - 1 - i, mod)
		ans %= mod
	return ans
print(solve())


(N, M, K) = map(int, input().split())
p = 998244353
cnt = 0
com = 1
for k in range(K + 1):
	l = N - k
	x = pow(M - 1, l - 1, p)
	cnt += M * x * com
	cnt %= p
	com *= N - (k + 1)
	com *= pow(k + 1, p - 2, p)
	com %= p
print(cnt)


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

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
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]
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)
for i in range(K + 1):
	res_i = M * pow(M - 1, N - i - 1, p) % p
	res_i = res_i * cmb(N - 1, i, p) % p
	ans = (ans + res_i) % p
print(ans)


(n, m, k) = map(int, input().split())
mod = 998244353
if m == 1:
	print(0 if k != n - 1 else 1)
	exit()
fact = [1] * (n - 1 + 1)
inv = [1] * (n - 1 + 1)
for i in range(2, n - 1 + 1):
	fact[i] = i * fact[i - 1] % mod
inv[-1] = pow(fact[-1], mod - 2, mod)
for i in range(n - 1, 1, -1):
	inv[i - 1] = inv[i] * i % mod
ans = 0
po = pow(m - 1, n - 1, mod) * m % mod
ue = fact[n - 1]
iii = pow(m - 1, mod - 2, mod) % mod
for i in range(k + 1):
	ans += ue * inv[n - 1 - i] % mod * inv[i] % mod * po % mod
	po *= iii
	po %= mod
print(ans % mod)


(n, m, k) = map(int, input().split())
MOD = 998244353
fac = [1] * (n + 1)
inv = [1] * (n + 1)
for j in range(1, n + 1):
	fac[j] = fac[j - 1] * j % MOD
inv[n] = pow(fac[n], MOD - 2, MOD)
for j in range(n - 1, -1, -1):
	inv[j] = inv[j + 1] * (j + 1) % MOD

def comb(n, r):
	if r > n or n < 0 or r < 0:
		return 0
	return fac[n] * inv[n - r] * inv[r] % MOD
ans = 0
for i in range(k + 1):
	ans += m * pow(m - 1, n - i - 1, MOD) * comb(n - 1, i) % MOD
print(ans % MOD)


MOD = 998244353
(n, m, k) = map(int, input().split())
fac = [1] * (n + 1)
fac_inv = [0] * (n + 1)
for i in range(n):
	fac[i + 1] = fac[i] * (i + 1) % MOD
fac_inv[-1] = pow(fac[-1], MOD - 2, MOD)
for i in range(n, 0, -1):
	fac_inv[i - 1] = fac_inv[i] * i % MOD

def comb(n, k):
	if k < 0 or k > n:
		return 0
	x = fac[n] * (fac_inv[k] * fac_inv[n - k]) % MOD % MOD
	return x
ans = 0
for i in range(k + 1):
	ans += comb(n - 1, i) * m % MOD * pow(m - 1, n - i - 1, MOD) % MOD
	ans %= MOD
print(ans)


(N, M, K) = map(int, input().split())
mod = 998244353
P = [1 for i in range(10 ** 6 + 1)]
for i in range(10 ** 6):
	P[i + 1] = P[i] * (i + 1) % mod

def comb(a, b):
	if a >= b:
		return P[a] * pow(P[a - b], mod - 2, mod) * pow(P[b], mod - 2, mod) % mod
	else:
		return 0
ans = 0
for i in range(K + 1):
	ans += M * comb(N - 1, i) * pow(M - 1, N - 1 - i, mod)
	ans %= mod
print(ans)


(n, m, k) = (int(i) for i in input().split())
mod = 998244353
fac = [1]
inv = []
for i in range(n - 1):
	fac.append(fac[-1] * (i + 2) % mod)
for i in range(n):
	inv.append(pow(fac[i], mod - 2, mod))

def modcom(n, k, fac, inv):
	if k > n or k < 0:
		return 0
	elif k == n or k == 0:
		return 1
	else:
		return fac[n - 1] * inv[k - 1] * inv[n - k - 1] % mod
r = 0
for i in range(0, k + 1):
	r += m % mod * pow(m - 1, n - 1 - i, mod) * modcom(n - 1, i, fac, inv)
print(r % mod)


(n, m, k) = map(int, input().split())
mod = 998244353
N = 10 ** 6
fact = [1, 1]
fact_inv = [1, 1]
inv = [0, 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
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)


(N, M, K) = map(int, input().split())
mod = 998244353
ans = 0
comb = [1]
for i in range(K):
	comb_temp = comb[i] * (N - 1 - i) * pow(i + 1, -1, mod)
	comb_temp %= mod
	comb.append(comb_temp)
for k in range(K + 1):
	ans_temp = M * comb[k] * pow(M - 1, N - 1 - k, mod)
	ans += ans_temp
	ans %= mod
print(ans)


mod = 998244353
(N, M, K) = map(int, input().split())
ans = 0

def pow(x, n):
	if n == 0:
		return 1
	if n % 2 == 0:
		return pow(x ** 2 % mod, n // 2) % mod
	else:
		return x * pow(x ** 2 % mod, (n - 1) // 2) % mod
A = 1
for i in range(K + 1):
	p = N - i
	x = M * pow(M - 1, p - 1) * A % mod
	ans += x
	A = A * (N - i - 1) % mod
	y = pow(i + 1, mod - 2)
	A = A * y % mod
print(ans % mod)


def main():
	(N, M, K) = list(map(int, input().split()))
	mod = 998244353
	r = 0
	m = 1
	inv = [0] * (N + 1)
	inv[1] = 1
	for i in range(2, N + 1):
		inv[i] = inv[mod % i] * ((mod - mod // i) % mod)
	for i in range(K + 1):
		if i > 0:
			m = m * (N - i) * inv[i] % mod
		r += M * pow(M - 1, N - i - 1, mod) * m
	return r % mod
print(main())


(N, M, K) = map(int, input().split())
MOD = 998244353
fact = [1]
rfact = [1]
for i in range(1, N + 1):
	fact.append(fact[i - 1] * i % MOD)
	rfact.append(pow(fact[i], MOD - 2, MOD))

def cmb(n, m):
	return fact[n] * rfact[m] * rfact[n - m] % MOD
answer = 0
for i in range(K + 1):
	answer += M * cmb(N - 1, i) * pow(M - 1, N - 1 - i, MOD) % MOD
print(answer % MOD)


MOD = 998244353
fac = [1] * (3 * 10 ** 5)
for i in range(len(fac) - 1):
	fac[i + 1] = fac[i] * (i + 1) % MOD

def comb(n, k):
	return fac[n] * pow(fac[n - k], MOD - 2, MOD) * pow(fac[k], MOD - 2, MOD) % MOD
(n, m, k) = map(int, input().split())
ans = 0
for a in range(n, n - k - 1, -1):
	ans += m * pow(m - 1, a - 1, MOD) * comb(n - 1, a - 1) % MOD
print(ans % MOD)


(N, M, K) = map(int, input().split())
MOD = 998244353
modinv = lambda a, mod=MOD: pow(a, mod - 2, mod)
comb = [M] * (K + 1)
for i in range(1, K + 1):
	comb[i] = comb[i - 1] * (N - i) % MOD
	comb[i] = comb[i] * modinv(i) % MOD
ans = 0
for i in range(K + 1):
	ans = (ans + comb[i] * pow(M - 1, N - i - 1, MOD)) % MOD
print(ans)


(n, M, K) = list(map(int, input().split()))
mod = 998244353
fac = [1] * (n + 1)
inv = [1] * (n + 1)
for j in range(1, n + 1):
	fac[j] = fac[j - 1] * j % mod
inv[n] = pow(fac[n], mod - 2, mod)
for j in range(n - 1, -1, -1):
	inv[j] = inv[j + 1] * (j + 1) % mod

def comb(n, r):
	if r > n or n < 0 or r < 0:
		return 0
	return fac[n] * inv[n - r] * inv[r] % mod
ans = 0
temp = M * (M - 1) ** (n - K - 1) % mod
for k in range(K + 1)[::-1]:
	ans = (ans + temp * comb(n - 1, k)) % mod
	temp = temp * (M - 1) % mod
print(ans)


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

def comb_list(n, r, mod):
	ret = [1]
	for i in range(1, r + 1):
		ret.append(ret[-1] * (n + 1 - i) * pow(i, mod - 2, mod) % mod)
	return ret
ans = 0
mod = 998244353
c_list = comb_list(N - 1, K, mod)
for i in range(K + 1):
	ans = (ans + c_list[i] * M * pow(M - 1, N - i - 1, mod)) % mod
print(ans)


import numpy as np
N = 10 ** 6
Nsq = 10 ** 3
mod = 998244353
(n, m, k) = list(map(int, input().split()))
fac = np.arange(N, dtype=np.int64).reshape(Nsq, Nsq)
fac[0, 0] = 1
for i in range(1, Nsq):
	fac[:, i] *= fac[:, i - 1]
	fac[:, i] %= mod
for i in range(1, Nsq):
	fac[i] *= fac[i - 1, -1]
	fac[i] %= mod
fac = fac.ravel()
finv = np.arange(1, N + 1, dtype=np.int64)[::-1].reshape(Nsq, Nsq)
finv[0, 0] = pow(int(fac[N - 1]), mod - 2, mod)
for i in range(1, Nsq):
	finv[:, i] *= finv[:, i - 1]
	finv[:, i] %= mod
for i in range(1, Nsq):
	finv[i] *= finv[i - 1, -1]
	finv[i] %= mod
finv = finv.ravel()[::-1]

def nCr(a, b):
	comb = fac[a] * finv[b] % mod * finv[a - b] % mod
	return comb
prt = [1] * (n + 1)
for i in range(n):
	prt[i + 1] = prt[i] * (m - 1) % mod
res = 0
for i in range(k + 1):
	res += m * prt[n - i - 1] % mod * nCr(n - 1, i)
	res %= mod
print(res)


(n, m, k) = map(int, input().split())
mod = 998244353
fact = [1, 1]
finv = [1, 1]
inv = [0, 1]
for i in range(2, n + 5):
	fact.append(fact[-1] * i % mod)
	inv.append(inv[mod % i] * (mod - mod // i) % mod)
	finv.append(finv[-1] * inv[-1] % mod)
f = pow(m - 1, mod - 2, mod)

def nCr(n, r, mod):
	if r > n:
		return 0
	else:
		return fact[n] * finv[r] * finv[n - r] % mod
ans = 0
for i in range(k + 1):
	ans += nCr(n - 1, i, mod) * m * pow(m - 1, n - 1 - i, mod) % mod
	ans %= mod
print(ans % mod)


(N, M, K) = list(map(int, input().split()))
MOD = 998244353
MAX_N = 10 ** 6
fac = [0] * MAX_N
fac_inv = [0] * MAX_N
fac[0] = 1
for i in range(MAX_N - 1):
	fac[i + 1] = fac[i] * (i + 1) % MOD
fac_inv[-1] = pow(fac[-1], MOD - 2, MOD)
for i in range(MAX_N - 2, -1, -1):
	fac_inv[i] = fac_inv[i + 1] * (i + 1) % MOD

def nCk(n, k):
	return fac[n] * fac_inv[k] % MOD * fac_inv[n - k] % MOD
ans = 0
for k in range(K + 1):
	temp = M * nCk(N - 1, k) % MOD * pow(M - 1, N - k - 1, MOD) % MOD
	ans += temp
	ans %= MOD
print(ans)


(N, M, K) = map(int, input().split())
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)

def comb(n, r):
	if n < r:
		return 0
	else:
		return fac[n] * (finv[r] * finv[n - r] % mod) % mod
ans = 0
for i in range(K + 1):
	ans += comb(N - 1, i) * M * pow(M - 1, N - 1 - i, mod)
	ans %= mod
print(ans)


(N, M, K) = map(int, input().split())
mod = 998244353
ans = 0
nCi = [1]
for i in range(1, N + 1):
	nCi.append(nCi[i - 1] * (N - i) * pow(i, mod - 2, mod) % mod)
for i in range(K + 1):
	ans += M * pow(M - 1, N - 1 - i, mod) * nCi[i]
	ans %= mod
print(ans)


Q = 998244353

def main():
	(N, M, K) = map(int, input().split())
	ans = 0
	cmb = 1
	for k in range(K + 1):
		ans += M * pow(M - 1, N - 1 - k, Q) % Q * cmb % Q
		ans %= Q
		cmb *= (N - k - 1) * pow(k + 1, Q - 2, Q) % Q
		cmb %= Q
	print(ans)
main()


import math
(N, M, K) = map(int, input().split())
mod = 998244353
ans = 0
d = [1] + [1]
e = [0] + [1]
f = [0] + [1]
for i in range(2, N + 1):
	d += [d[i - 1] * i % mod]
	e += [e[mod % i] * (mod - int(mod / i)) % mod]
	f += [f[i - 1] * e[i] % mod]

def combinations_count(n, r):
	if r == n or r == 0:
		return 1
	return d[n] * f[n - r] * f[r] % mod
for i in range(K + 1):
	l = M * pow(M - 1, N - 1 - i, mod) % mod
	ans += l * combinations_count(N - 1, i) % mod
	ans %= mod
print(ans)