output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N M K
attempt: # ------------------------------warmup----------------------------
  import os
  import sys
  from io import BytesIO, IOBase
  
  BUFSIZE = 8192
  
  
  class FastIO(IOBase):
      newlines = 0
  
      def __init__(self, file):
          self._fd = file.fileno()
          self.buffer = BytesIO()
          self.writable = "x" in file.mode or "r" not in file.mode
          self.write = self.buffer.write if self.writable else None
  
      def read(self):
          while True:
              b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
              if not b:
                  break
              ptr = self.buffer.tell()
              self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
          self.newlines = 0
          return self.buffer.read()
  
      def readline(self):
          while self.newlines == 0:
              b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
              self.newlines = b.count(b"\n") + (not b)
              ptr = self.buffer.tell()
              self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
          self.newlines -= 1
          return self.buffer.readline()
  
      def flush(self):
          if self.writable:
              os.write(self._fd, self.buffer.getvalue())
              self.buffer.truncate(0), self.buffer.seek(0)
  
  
  class IOWrapper(IOBase):
      def __init__(self, file):
          self.buffer = FastIO(file)
          self.flush = self.buffer.flush
          self.writable = self.buffer.writable
          self.write = lambda s: self.buffer.write(s.encode("ascii"))
          self.read = lambda: self.buffer.read().decode("ascii")
          self.readline = lambda: self.buffer.readline().decode("ascii")
  
  
  sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
  input = lambda: sys.stdin.readline().rstrip("\r\n")
  
  # -------------------game starts now-----------------------------------------------------
  n, m, k = map(int, input().split())
  a = [0] * (k + 1)
  a[0] = 1
  for i in range(1, k + 1):
      a[i] = (a[i - 1] * (n - i)) // (i)
  e = pow(m - 1, n - 1)
  ans = 0
  mod = 998244353
  for i in range(k + 1):
      ans += ((m % mod) * (e % mod) * (a[i] % mod)) % mod
      e //= m - 1
      ans %= mod
  print(ans)
  
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"}]