Consider the following experiment. You have a deck of m cards, and exactly one card is a joker. n times, you do the following: shuffle the deck, take the top card of the deck, look at it and return it into the deck.

Let x be the number of times you have taken the joker out of the deck during this experiment. Assuming that every time you shuffle the deck, all m! possible permutations of cards are equiprobable, what is the expected value of x^k? Print the answer modulo 998244353.

Input

The only line contains three integers n, m and k (1 ≤ n, m < 998244353, 1 ≤ k ≤ 5000).

Output

Print one integer — the expected value of x^k, taken modulo 998244353 (the answer can always be represented as an irreducible fraction a/b, where b mod 998244353 ≠ 0; you have to print a ⋅ b^{-1} mod 998244353).

Examples

Input


1 1 1


Output


1


Input


1 1 5000


Output


1


Input


2 2 2


Output


499122178


Input


998244352 1337 5000


Output


326459680

Difficulty: VERY_HARD
Tags: Probability

Combinatorics

Number theory

Dynamic programming

Mathematics
Skill types: Dynamic programming

Starter code:

Solutions:
class UnionFindVerSize:

	def __init__(self, N):
		self._parent = [n for n in range(0, N)]
		self._size = [1] * N
		self.group = N

	def find_root(self, x):
		if self._parent[x] == x:
			return x
		self._parent[x] = self.find_root(self._parent[x])
		stack = [x]
		while self._parent[stack[-1]] != stack[-1]:
			stack.append(self._parent[stack[-1]])
		for v in stack:
			self._parent[v] = stack[-1]
		return self._parent[x]

	def unite(self, x, y):
		gx = self.find_root(x)
		gy = self.find_root(y)
		if gx == gy:
			return
		self.group -= 1
		if self._size[gx] < self._size[gy]:
			self._parent[gx] = gy
			self._size[gy] += self._size[gx]
		else:
			self._parent[gy] = gx
			self._size[gx] += self._size[gy]

	def get_size(self, x):
		return self._size[self.find_root(x)]

	def is_same_group(self, x, y):
		return self.find_root(x) == self.find_root(y)
import sys, random, bisect
from collections import deque, defaultdict
from heapq import heapify, heappop, heappush
from itertools import permutations
from math import log, gcd
input = lambda : sys.stdin.buffer.readline()
mi = lambda : map(int, input().split())
li = lambda : list(mi())

def cmb(n, r, mod):
	if r < 0 or r > n:
		return 0
	r = min(r, n - r)
	return g1[n] * g2[r] % mod * g2[n - r] % mod
mod = 998244353
N = 5100
g1 = [1] * (N + 1)
g2 = [1] * (N + 1)
inverse = [1] * (N + 1)
for i in range(2, N + 1):
	g1[i] = g1[i - 1] * i % mod
	inverse[i] = -inverse[mod % i] * (mod // i) % mod
	g2[i] = g2[i - 1] * inverse[i] % mod
inverse[0] = 0
(n, m, k) = mi()
im = pow(m, mod - 2, mod)
im_1 = pow(m - 1, mod - 2, mod)
if n <= k and 1:
	res = 0
	for i in range(n + 1):
		res += cmb(n, i, mod) * pow(im, i, mod) % mod * (pow(1 - im, n - i, mod) * pow(i, k, mod) % mod) % mod
		res %= mod
	print(res)
else:
	dp = [1]
	for i in range(k):
		dp.append(0)
		for j in range(i, -1, -1):
			dp[j + 1] += dp[j] * (n - j)
			dp[j + 1] %= mod
			dp[j] *= j
			dp[j] %= mod
	if m != 1:
		res = 0
		c = m * im_1 % mod
		for i in range(k + 1):
			res += dp[i] * pow(c, n - i, mod) % mod * pow(im_1, i, mod) % mod
			res %= mod
		res *= pow((m - 1) * im, n, mod)
		res %= mod
		print(res)
	else:
		print(pow(n, k, mod))


dp = [0] * 5010
dp[0] = 1
(n, m, k) = map(int, input().split())
t = 998244353
for i in range(k):
	for j in range(len(dp) - 1, -1, -1):
		if j == 0:
			dp[j] = 0
		else:
			dp[j] = (dp[j - 1] * (n - j + 1) + dp[j] * j) % t
c = 0
for i in range(k + 1):
	c += pow(m, max(n - i, 0), t) * dp[i]
	c %= t
den = pow(m, n, t)
den = pow(den, t - 2, t)
print(den * c % t)


def inv(a):
	return pow(a, MOD - 2, MOD) % MOD

def fat(a):
	ans = 1
	for i in range(1, a + 1):
		ans = ans * i % MOD
	return ans
MOD = 998244353
(n, m, k) = map(int, input().split())
p = inv(m)
if n <= k:
	q = (1 - p + MOD) % MOD
	inv_q = inv(q)
	p_aux = p
	q_aux = pow(q, n - 1, MOD)
	fn = n
	resp = n * p % MOD * q_aux % MOD
	resp = resp % MOD
	for i in range(2, n + 1):
		x = pow(i, k, MOD)
		p_aux = p_aux * p % MOD
		q_aux = q_aux * inv_q
		fn = fn * (n - i + 1) % MOD * inv(i) % MOD
		resp = resp + x * fn % MOD * p_aux % MOD * q_aux % MOD
		resp = resp % MOD
	print(resp)
else:
	deriv = [n * p % MOD]
	resp = n * n % MOD * p % MOD * p % MOD - n * p % MOD * p % MOD + n * p % MOD
	deriv.append(resp % MOD)
	fn = n * (n - 1) % MOD
	v = [1]
	for i in range(3, k + 1):
		fn = fn * (n - i + 1) % MOD % MOD
		w = [-(i - 1) * v[0] % MOD]
		for j in range(len(v) - 1):
			w.append((v[j] - (i - 1) * v[j + 1] % MOD) % MOD)
		w.append((v[-1] + i - 1) % MOD)
		v = tuple(w)
		resp = fn * pow(p, i, MOD) % MOD
		for j in range(len(v)):
			resp = (resp + v[j] * deriv[j] % MOD) % MOD
			resp = resp % MOD
		resp %= MOD
		deriv.append(resp)
	print(deriv[k - 1])