output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N M K
attempt: ##through permutations and combinations we can reduce ans to
  ##  Summation N-1CK(m-1)^(N-1-K)
  
  
  import sys
  
  sys.setrecursionlimit(100000000)
  DP = {}
  mod = 998244353
  product = {}
  N = 1000001
  
  # array to store inverse of 1 to N
  factorialNumInverse = [None] * (N + 1)
  
  # array to precompute inverse of 1! to N!
  naturalNumInverse = [None] * (N + 1)
  
  # array to store factorial of
  # first N numbers
  fact = [None] * (N + 1)
  
  
  # Function to precompute inverse of numbers
  def InverseofNumber(p):
      naturalNumInverse[0] = naturalNumInverse[1] = 1
      for i in range(2, N + 1, 1):
          naturalNumInverse[i] = naturalNumInverse[p % i] * (p - int(p / i)) % p
  
  
  # Function to precompute inverse
  # of factorials
  def InverseofFactorial(p):
      factorialNumInverse[0] = factorialNumInverse[1] = 1
  
      # precompute inverse of natural numbers
      for i in range(2, N + 1, 1):
          factorialNumInverse[i] = (naturalNumInverse[i] * factorialNumInverse[i - 1]) % p
  
  
  # Function to calculate factorial of 1 to N
  def factorial(p):
      fact[0] = 1
  
      # precompute factorials
      for i in range(1, N + 1):
          fact[i] = (fact[i - 1] * i) % p
  
  
  # Function to return nCr % p in O(1) time
  def Binomial(N, R, p):
  
      # n C r = n!*inverse(r!)*inverse((n-r)!)
      ans = ((fact[N] * factorialNumInverse[R]) % p * factorialNumInverse[N - R]) % p
      return ans
  
  
  def getproduct(M, n):
      # product=(M-1)^n
      global mod, product
      fact = 1000
      if n - 1 in product:
          product[n] = (M * product[n - 1]) % mod
          return (M * product[n - 1]) % mod
      if n < fact:
          return (M**n) % mod
      else:
          Q = int(n / fact)
          R = n % fact
          prev = 1
          for q in range(Q):
              prev = (prev * ((M**fact) % mod)) % mod
          prev = prev * ((M**R) % mod)
          product[n] = prev % mod
          return prev % mod
  
  
  def ncr(n, r, p):
      # initialize numerator
      # and denominator
      num = den = 1
      for i in range(r):
          num = (num * (n - i)) % p
          den = (den * (i + 1)) % p
      return (num * pow(den, p - 2, p)) % p
  
  
  def G(N, M, K):
      global mod
      res = 0
      for k in range(K, -1, -1):
          res = (
              res
              + (
                  (Binomial(N - 1, k, mod))
                  % mod
                  * (M * getproduct(M - 1, N - k - 1))
                  % mod
              )
              % mod
          ) % mod
      return res % mod
  
  
  def F(curr, N, M, K):
      global DP
      if (curr, K) in DP:
          return DP[(curr, K)]
      if curr == N:
          return 1
      if curr == 0:
          return M * F(curr + 1, N, M, K)
      else:
          a = 0
          if K > 0:
              a = F(curr + 1, N, M, K - 1)
          b = (M - 1) * F(curr + 1, N, M, K)
          DP[(curr, K)] = a + b
          return a + b
  
  
  N, M, K = map(int, input().strip().split())
  InverseofNumber(mod)
  InverseofFactorial(mod)
  factorial(mod)
  # print(F(0,N,M,K)%mod)
  print(G(N, M, K))
  
problem_description: Statement
  
  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.
samples: [{"input": "3 2 1", "output": "6\n    \n\nThe following ways to paint the blocks satisfy the conditions: `112`, `121`,\n`122`, `211`, `212`, and `221`. Here, digits represent the colors of the\nblocks.\n\n* * *"}, {"input": "100 100 0", "output": "73074801\n    \n\n* * *"}, {"input": "60522 114575 7559", "output": "479519525"}]