CodeEff/ECCO huggingface dataset:
# Original solution
k = int(eval(input()))
a,b = list(map(int,input().split()))
flag = "ng"
for i in range(a,b+1):
    if i % k == 0:
        flag = "ok"
if flag == "ok":
    print("OK")
else:
    print("NG")

# Optimized solution
k = int(eval(input()))
a,b = list(map(int,input().split()))
for i in range(a,b+1):
    if i%k == 0:
        print("OK")
        break
else:
    print("NG")
# Original solution
K = eval(input())
A, B = list(map(int, input().split()))

if int(B) - int(A) + 1 >= int(K):
  print('OK')
else:
  i = int(A)
  while i < int(B) + 1:
    if i % int(K) == 0:
      print('OK')
    else:
      i = i+1
  print('NG')

# Optimized solution
K = eval(input())
li = input().split()
A = int(li[0])
B = int(li[1])

if B - A + 1 >= int(K):
  print('OK')
else:
  i = A
  while i < B + 1:
    if i % int(K) == 0:
      print('OK')
    else:
      i = i+1
  print('NG')
# Original solution
k = int(eval(input()))
a,b = [int(a) for a in input().split()]
c=0
for i in range (a,b+1):
  if i%k!=0:
     continue
  else:
    c+=1
    break   
if c==1:
  print("OK")
else:
  print("NG")       
    

# Optimized solution
k = int(eval(input()))
a,b = [int(a) for a in input().split()]
c=0
for i in range (a,b+1):
  if i%k!=0:
    c+=1
if c==b-a+1:
  print("NG")
else:
  print("OK")
# Original solution
k, a, b = list(map(int, open(0).read().split()))
for i in range(b+1):
    if k * i > b:
        print('NG')
        break
    if k * i >= a:
        print('OK')
        break

# Optimized solution
k,a,b=list(map(int,open(0).read().split()));print(('ONKG'[b<b%k+a::2]))
# Original solution
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

K = ir()
A, B = lr()
left = -(-A//K)
right = B // K
bl = left <= right
if A % K == 0 or B % K == 0:
    bl = True
print(('OK' if bl else 'NG'))


# Optimized solution
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

K = ir()
A, B = lr()
left = -(-A//K)
right = B // K
bl = left <= right
print(('OK' if bl else 'NG'))
# Original solution
K = int(eval(input()))
l, h = list(map(int, input().split(' ')))

for n in range(l, h + 1):
    if n % K == 0:
        print('OK')
        break
else:
    print('NG')


# Optimized solution
K = int(eval(input()))
A, B = list(map(int, input().split(' ')))

if B // K * K >= A:
    print('OK')
else:
    print('NG')
# Original solution
#設定
import sys
input = sys.stdin.buffer.readline

#ライブラリインポート
from collections import defaultdict

con = 10 ** 9 + 7
#入力受け取り
def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	K = int(eval(input()))
	A, B = getlist()
	for i in range(1001):
		if A <= K * i and K * i <= B:
			print("OK")
			return

	print("NG")
	


if __name__ == '__main__':
	main()

# Optimized solution
import sys; input = sys.stdin.buffer.readline
from collections import defaultdict
con = 10 ** 9 + 7

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

def main():
	K = int(eval(input()))
	A, B = getlist()
	for i in range(1001):
		if A <= K * i and K * i <= B:
			print("OK")
			return

	print("NG")
	


if __name__ == '__main__':
	main()
# Original solution
k = int(eval(input()))
a, b = list(map(int, input().split()))
if k == 1:
  print("OK")
else:
  if b//k - a//k == 0 and a%k != 0:
    print("NG")
  else:
    print("OK")

# Optimized solution
k = int(eval(input()))
a, b = list(map(int, input().split()))

if b//k - a//k == 0 and a%k != 0:
  print('NG')
else:
  print('OK')
# Original solution
K = int(eval(input()))
A,B = list(map(int,input().split()))

import sys


for i in range(A,B+1):
    if i % K == 0:
        print('OK')
        sys.exit()
        
print('NG')

# Optimized solution
K = int(eval(input()))
A,B = list(map(int,input().split()))

tmp = B//K * K

if A <= tmp:
    print('OK')
else:
    print('NG')
# Original solution
K = int(eval(input()))
a, b = list(map(int, input().split()))

if a%K == 0:
    print('OK')
elif (a//K+1)*K <= b:
    print('OK')
else:
    print('NG')

# Optimized solution
K = int(eval(input()))
A, B = list(map(int, input().split()))

lar = B//K * K
if lar >= A:
    print('OK')
else:
    print('NG')
# Original solution
# import numpy as np
# import queue
# import heapq


def main():
    print((resolve()))


def resolve():
    K = int(eval(input()))
    A, B = list(map(int, input().split()))

    for n in range(A, B+1):
        if n % K == 0:
            return 'OK'

    return 'NG'


if __name__ == "__main__":
    main()


# Optimized solution
def main():
    K = int(eval(input()))
    A, B = list(map(int, input().split()))

    if A % K == 0 or B % K == 0:
        print('OK')
    elif A // K != B // K:
        print('OK')
    else:
        print('NG')


if __name__ == "__main__":
    main()
# Original solution
K = int(eval(input()))
A, B = list(map(int, input().split()))

flag = False
for i in range(A, B+1):
    if i % K == 0:
        flag = True

if (flag):
    print('OK')
else:
    print('NG')


# Optimized solution
k = int(eval(input()))
a, b = list(map(int,input().split()))

for i in range(a,b+1):
    if i % k == 0:
        print('OK')
        quit()

print('NG')
# Original solution
k = int(eval(input()))
a, b = list(map(int, input().split()))
for i in range(a, b + 1):
    if i % k == 0:
        print("OK")
        break
else:
    print("NG")


# Optimized solution
K=int(eval(input()))
A,B=list(map(int, input().split()))
ans='NG'
for i in range (A,B+1):
    if i%K==0:
        ans='OK'
        break
print(ans)
# Original solution
k = int(eval(input()))
a, b = list(map(int, input().split()))

is_ok = False
for i in range(a, b+1):
    if i % k == 0:
        is_ok = True

print(("OK" if is_ok else "NG"))

# Optimized solution
K = int(eval(input()))
A, B = list(map(int, input().split()))

is_ok = False
# A以上B以下の要素xについて
for x in range(A, B + 1):
    # x が K の倍数であれば is_ok = True
    if x % K == 0:
        is_ok = True

print(("OK" if is_ok else "NG"))
# Original solution
K = int(eval(input()))
A, B = list(map(int, input().split()))

print(("OK" if A <= (B // K) * K else "NG"))

# Optimized solution
K = int(eval(input()))
A, B = list(map(int, input().split()))

print(("OK" if A // K != B // K or A % K == 0 else "NG"))
# Original solution
K=int(eval(input()))
A,B=list(map(int, input().split()))
for i in range(A,B+1):
    if i%K==0:
        print('OK')
        exit()
print('NG')

# Optimized solution
K=int(eval(input()))
A,B=list(map(int, input().split()))
print(('OK' if (A+K-1)//K*K <= B else 'NG'))
# Original solution
K=int(eval(input()))
A,B=list(map(int,input().split()))
for i in range(A,B+1):
    if i%K==0:
        print("OK")
        exit()
print("NG")

# Optimized solution
K=int(eval(input()))
A,B=list(map(int,input().split()))
for n in range(A,B+1):
    if n%K==0:
        print("OK")
        exit()
print("NG")
# Original solution

H, A = list(map(int, input().split()))

ans = (H + A - 1) // A
print(ans)

# Optimized solution
H, A = list(map(int, input().split()))

ans = (H + A - 1 ) // A
print((int(ans)))
# Original solution
import sys

for line in sys.stdin:
    l= line.split()
    H=int(l[0])
    A=int(l[1])
    i = 0
    while(H>0):
        H-=A
        i+=1
    print(i)


# Optimized solution
h,a = list (map (int, input ().split ()))
print(((h + a - 1) // a))
# Original solution
H,A=list(map(int,input().split()))
count=0
while(H>0):
   H-=A
   count+=1
print(count)

# Optimized solution
h,a=list(map(int,input().split()))
print(((h+a-1)//a))
# Original solution
l = list(map(int, input().split()))

def attack(l):
    H = l[0]
    A = l[1]
    cnt = 0
    while H > 0:
        H -= A
        cnt += 1
    return cnt

print((attack(l)))


# Optimized solution
l1 = list(map(int, input().split()))

H = l1[0]
A = l1[1]

T = H%A
if T == 0:
  print((H//A))
else:
  print((H//A+1))
# Original solution
a, b = list(map(int,input().strip().split()))
print((a//b+1 if a%b else a//b))

# Optimized solution
a, b = list(map(int,input().split()))
if a%b:
	print((a//b+1))
else:
  print((a//b))
# Original solution
h,a=list(map(int,input().split()))

print(((h+a-1)//a))


# Optimized solution
h,a=list(map(int,input().split()))
print((-(-h//a)))
# Original solution
_input = input().split()

h = int(_input[0])
a = int(_input[1])

if h % a == 0:
  print((int(h / a)))
else:
  print((int(h / a) + 1))

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

if N % K == 0:
  print((int(N / K)))
else:
  print((int(N / K) + 1))
# Original solution
a,b=list(map(int,input().split()))

c=0
while a>0:
    a-=b
    c+=1
print(c)

# Optimized solution
a,b=list(map(int,input().split()))
print((-(-a//b)))
# Original solution
import math


def main():
    hp, attack = (int(i) for i in input().rstrip().split(' '))
    print((str(math.ceil(hp / attack))))


if __name__ == '__main__':
    main()



# Optimized solution
import math


def main():
    hp, attack = (int(i) for i in input().rstrip().split(' '))
    ans = str(math.ceil(hp / attack))
    print(ans)


if __name__ == '__main__':
    main()
# Original solution
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('a1.in')


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


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


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


def read_str():
    return eval(input())


def main():
    H, A = read_int_list()
    res = 0
    for i in range(10001):
      H = H - A
      res += 1
      if H <= 0:
        break
    print(res)


main()


# Optimized solution
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('a1.in')


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


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


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


def read_str():
    return eval(input())


def main_0():
    H, A = read_int_list()
    res = 0
    for i in range(10001):
      H = H - A
      res += 1
      if H <= 0:
        break
    print(res)


def main_1():
    H, A = read_int_list()
    res = H // A
    if H % A != 0:
      res += 1
    print(res)


def main():
    H, A = read_int_list()
    res = 0
    while H > 0:
      H -= A
      res += 1
    print(res)

main()
# Original solution
h,a = list(map(int, input().split()))
i = 0
while i < 10**4:
    i += 1
    h = h - a
    if h <= 0:
        print(i)
        break 

# Optimized solution
h, a = list(map(int,input().split()))
print((h//a + (h%a!=0)))
# Original solution
h,a=list(map(int,input().split()))

i=0
while h>0:
  h=h-a
  i+=1
  
print(i)

# Optimized solution
h,a=list(map(int,input().split()))

print((-(-h//a)))
# Original solution
h, a = list(map(int, input().split()))

ans = 0
while h > 0:
  h -= a
  ans += 1

print(ans)

# Optimized solution
import math
h, a = list(map(int, input().split()))

ans = 0
print((math.ceil(h/a)))
# Original solution
import sys

h, a = list(map(int, sys.stdin.readline().split()))

def main():
    return (h + a - 1) // a

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

# Optimized solution
import sys

h, a = list(map(int, sys.stdin.readline().split()))

def main():
    print(((h + a - 1) // a))

if __name__ ==  '__main__':
    main()
# Original solution
h, a = list(map(int, input().split()))

ans = 0

while h > 0:
    h -= a
    ans += 1

print(ans)

# Optimized solution
h, a = list(map(int, input().split()))
ans = 1 + (h - 1) // a

print(ans)
# Original solution
H, A = list(map(int, input().split()))
print(((H + A - 1) // A))


# Optimized solution
H, A = list(map(int, input().split()))
print(((H - 1) // A + 1))
# Original solution
H, A=list(map(int, input().split()))
ans=0
while H>0:
  ans+=1
  H-=A
print(ans)

# Optimized solution
H, A=list(map(int, input().split()))
print(((H-1)//A+1))
# Original solution
#template
from collections import Counter
def inputlist(): return [int(j) for j in input().split()]
H,A = inputlist()
d = H //A
m = H % A
if m != 0:
    d +=1
print(d)

# Optimized solution
#template
def inputlist(): return [int(k) for k in input().split()]
#template
H,A = inputlist()
if H % A == 0:
    print((H//A))
else:
    print(((H//A)+1))
# Original solution
h,a=list(map(int,input().split()))
l=0
while h>0:
    h = h-a
    l += 1
print(l)

# Optimized solution
H, A = list(map(int, input().split()))
print((H//A if H % A == 0 else H//A+1))
# Original solution
H,A = list(map(int, input().split()))
count = 0

for i in range(10000):
    if i*A >= H:
        break
    else:
        i += 1
        count += 1
print(count)

# Optimized solution
H,A = list(map(int, input().split()))

print((-(-H//A)))
# Original solution
h, a = list(map(int, input().split()))
if h % a == 0:
  print((h//a))
else:
  print((h//a + 1))


# Optimized solution
a, b = list(map(int, input().split()))
print((-(-a//b)))
# Original solution
H, A = list(map(int, input().split()))

print(((H-1)//A + 1))

# Optimized solution
H, A = list(map(int, input().split()))

print(((H+A-1)//A))
# Original solution
H,A=list(map(int,input().split()))
print(((H+A-1)//A))

# Optimized solution
H,A=list(map(int,input().split()))
print((-(-H//A)))
# Original solution
import itertools
import math
import fractions
import functools
h, a = list(map(int,input().split()))
print((math.ceil(h / a)))

# Optimized solution
h, a = list(map(int, input().split()))

print(((h+a-1)//a))
# Original solution
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
#  = int(input())
h, a  = list(map(int, input().split()))
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()
if h%a==0:
	print((int(h/a)))
else:
  	print((h//a+1))

# Optimized solution
#import collections
#import itertools as it
#import math
#import numpy as np
#import sys 
#sys.exit()

#  = input()
#  = int(input())
h, a  = list(map(int, input().split()))
'''
#  = list(map(int, input().split()))
'''
'''
n = input()
a = [int(input()) for i in range(n)]
'''
'''
n,m = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(m)]
'''
# c = collections.Counter()
#-------------------------------#

if h%a==0:
	print((int(h/a)))
else:
  	print((h//a+1))
# Original solution
H, A = list(map(int, input().split()))
cnt = 0
while(H > 0):
    H = H - A
    cnt += 1
print(cnt)

# Optimized solution
H, A = list(map(int, input().split()))
total = H // A
if H % A != 0:
    print((total+1))
else:
    print(total)
# Original solution
h,a=list(map(int,input().split()))
print((0--h//a))

# Optimized solution
print((-eval(input().replace(' ','//-'))))
# Original solution
H, A = list(map(int, input().split()))
import math
print((math.ceil(H/A)))

# Optimized solution
H, A = list(map(int, input().split()))
print((H // A if H % A == 0 else (H // A) + 1))
# Original solution
H, A = list(map(int, input().split()))

x = 0
while True:
  if H <= 0:
    break
  if H > 0:
    H -= A
    x += 1
print(x)

# Optimized solution
H, A = list(map(int, input().split()))

print(((H+A-1)//A))
# Original solution
H,A = list(map(int, input().split()))
print((-(-H//A)))

# Optimized solution
H,A = list(map(int, input().split()))
print((int(-(-H//A))))
# Original solution
h,a = list(map(int,input().split()))
print(((h + a - 1) // a))

# Optimized solution
h,a = list(map(int,input().split()))
cnt = 0
while h > 0:
    h -= a
    cnt += 1
print(cnt)
# Original solution
H, A = list(map(int, input().split()))
i = 0

while H > 0:
	H = H - A
	i = i + 1

print(i)

# Optimized solution
H, A = list(map(int, input().split()))

print((int((H + A - 1) / A)))
# Original solution
n, m, k = list(map(int, input().split()))
mod = 998244353

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

print(ans)

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

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

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

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

print(ans)

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

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

print(ans)
# Original solution
MOD = 998244353
#階乗のリストを作成する
N, M, K = list(map(int, input().split()))
frac = [1]
for i in range(N):
    frac.append(frac[i]*(i+1)%MOD)

#上の公式を用いてcombの計算を行う
def comb(n, k, mod):
    a=frac[n]
    b=frac[k]
    c=frac[n-k]
    return (a * pow(b, mod-2, mod) * pow(c, mod-2, mod)) % mod
  
def main():
  ans = [0] * (K+1)
  temp = 1
  for i in range(N):
    if i == 0:
      temp*=M
      temp %= MOD
    else:
      temp *= (M-1)
      temp %= MOD
    if i+1 >= N-K:
      ans[i+1-N+K] = temp
  t_ans = 0
  key = 1
  for i in range(len(ans)):
    t_ans += (ans[-1-i]*key) % MOD
    t_ans %= MOD
    key *= (N-i-1)
    key //= (i+1)
  print(t_ans)
if __name__ == "__main__":
  main()

# Optimized solution
MOD = 998244353
#階乗のリストを作成する
N, M, K = list(map(int, input().split()))
frac = [1]
for i in range(N):
    frac.append(frac[i]*(i+1)%MOD)

#上の公式を用いてcombの計算を行う
def comb(n, k, mod):
    a=frac[n]
    b=frac[k]
    c=frac[n-k]
    return (a * pow(b, mod-2, mod) * pow(c, mod-2, mod)) % mod
  
def main():
  ans = [0] * (K+1)
  temp = 1
  for i in range(N):
    if i == 0:
      temp*=M
      temp %= MOD
    else:
      temp *= (M-1)
      temp %= MOD
    if i+1 >= N-K:
      ans[i+1-N+K] = temp
  t_ans = 0
  for i in range(len(ans)):
    key = comb(N-1, i, MOD)
    t_ans += (ans[-1-i]*key)
    t_ans %= MOD
  print(t_ans)
if __name__ == "__main__":
  main()
# Original solution
MOD = 10000000007
lim = 200000
MOD = 998244353

inv_t = [-1 for i in range(lim+1)]
factrial = [-1 for i in range(lim+1)]
factrial_inv = [-1 for i in range(lim+1)]


def set_inv(max=lim):
    inv_t[0] = 0
    for i in range(1, max):
        if inv_t[i] == -1:
            _ = mod_inv(i)
            inv_t[i] = _


def mod_inv(x, mod=MOD):
    y, u, v, _x = mod, 1, 0, x
    while y:
        t = _x//y
        _x -= t*y
        _x, y = y, _x
        u -= t*v
        u, v = v, u
    u %= mod
    if u < 0:
        u += mod
    return u


def mod_pow(a, n, mod=MOD):
    res = 1
    while n:
        if n & 1:
            res = res*a % mod
        a = a*a % mod
        n >>= 1
    return res


def set_factrial(max=lim, mod=MOD):
    c = 1
    factrial[0] = factrial_inv[0] = 1
    for i in range(1, max):
        c *= i
        c %= mod
        factrial[i] = c
        factrial_inv[i] = mod_inv(c, mod)


def comb(a, b, mod=MOD):
    if factrial == -1:
        set_factrial()
    return (factrial[a]*factrial_inv[b]*factrial_inv[a-b]) % MOD


n, m, k = [int(_) for _ in input().split()]
ans = 0
set_inv()
set_factrial()
for i in range(k+1):
    ans += m*comb(n-1, i)*mod_pow(m-1, n-1 - i)
    ans %= MOD
    # print(ans)
print(ans)


# Optimized solution
MOD = 998244353

lim = 200000
inv_t = [-1 for i in range(lim+1)]
factrial = [-1 for i in range(lim+1)]
factrial_inv = [-1 for i in range(lim+1)]


def set_inv(max=lim):
    inv_t[0] = 0
    for i in range(1, max):
        inv_t[i] == mod_inv(i)


def mod_inv(x, mod=MOD):
    y, u, v, _x = mod, 1, 0, x
    while y:
        t = _x//y
        _x -= t*y
        _x, y = y, _x
        u -= t*v
        u, v = v, u
    u %= mod
    if u < 0:
        u += mod
    return u


def mod_pow(a, n, mod=MOD):
    res = 1
    while n:
        if n & 1:
            res = res*a % mod
        a = a*a % mod
        n >>= 1
    return res


def set_factrial(max=lim, mod=MOD):
    c = 1
    factrial[0] = factrial_inv[0] = 1
    for i in range(1, max):
        c *= i
        c %= mod
        factrial[i] = c
        factrial_inv[i] = mod_inv(c, mod)


def comb(a, b, mod=MOD):
    if factrial[0] == -1:
        set_factrial()
    return (factrial[a]*factrial_inv[b]*factrial_inv[a-b]) % mod


n, m, k = [int(_) for _ in input().split()]
ans = 0
for i in range(k+1):
    ans += m*comb(n-1, i)*mod_pow(m-1, n-1 - i)
    ans %= MOD
    # print(ans)
print(ans)
# Original solution
from math import factorial

# def comb(n,r):
#     return(factorial(n) // (factorial(n-r) * factorial(r)))

def comb(n,k,p):
    if n<0 or k<0 or n<k: return 0
    if n==0 or k==0: return 1
    a=factorial(n) %p
    b=factorial(k) %p
    c=factorial(n-k) %p
    return (a*power_func(b,p-2,p)*power_func(c,p-2,p))%p
def power_func(a,b,p):
    if b==0: return 1
    if b%2==0:
        d=power_func(a,b//2,p)
        return d*d %p
    if b%2==1:
        return (a*power_func(a,b-1,p ))%p


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

mod = 998244353 #出力の制限
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 )

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

s = 0

for x in range(k+1):
    s += m * (power_func(m-1,n-1-x,998244353)% 998244353) * (cmb(n-1,x,998244353) % 998244353)
    s %= 998244353
print(s)

# Optimized solution

def power_func(a,b,p):
    if b==0: return 1
    if b%2==0:
        d=power_func(a,b//2,p)
        return d*d %p
    if b%2==1:
        return (a*power_func(a,b-1,p ))%p


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

mod = 998244353
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]

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

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 x in range(k+1):
    s += (m * power_func(m-1,n-1-x,998244353) * cmb(n-1,x,998244353)) % 998244353
    s %= 998244353
print(s)
# Original solution
n,m,k = list(map(int,input().split()))
mod = 998244353
def pascal(n):
    line = [1]
    for k in range(n):
        line.append(int(line[k] * (n-k) // (k+1)) )
    return line
line = pascal(n-1)
#print(line)

mm1 = [1]

for i in range(1, n+1):
    mm1 += [(mm1[-1] * (m-1)) % mod]

mm = [1]
for i in range(1, n+1):
    mm += [(mm[-1] * (m)) % mod]

ans = 0
for i in range(k+1):
    if i == 0:
        ans += (mm1[n-1] * m ) % mod
        continue
    if i == n-1:
        ans += (m)
        break
    ans += (mm1[n-1-i] * line[i] * m) % mod

ans = (ans)%mod
print(ans)



# Optimized solution
max_n=2 * 10**5
mod=998244353
fact, inv_fact = [0] * (max_n + 1), [0] * (max_n + 1)
fact[0] = 1
for i in range(max_n):
    fact[i + 1] = fact[i] * (i + 1) % mod

inv_fact[-1] = pow(fact[-1], mod - 2, mod)
for i in reversed(list(range(max_n))):
    inv_fact[i] = inv_fact[i + 1] * (i + 1) % mod

def nCr_mod(n, r):
    res = 1
    while n or r:
        a, b = n % mod, r % mod
        if a < b:
            return 0
        res = res * fact[a] % mod * inv_fact[b] % mod * inv_fact[a - b] % mod
        n //= mod
        r //= mod
    return res
n,m,k = list(map(int,input().split()))


mm1 = [1]

for i in range(1, n+1):
    mm1 += [(mm1[-1] * (m-1)) % mod]

mm = [1]
for i in range(1, n+1):
    mm += [(mm[-1] * (m)) % mod]

ans = 0
for i in range(k+1):
    if i == 0:
        ans += (mm1[n-1] * m ) % mod
        continue
    if i == n-1:
        ans += (m)
        break
    ans += (mm1[n-1-i] * nCr_mod(n-1,i) * m) % mod

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

ans = 0
t = 1
b = 1
for i in range(k+1):
  ans += t * pow(m-1, n-1-i, mod) * pow(b, mod-2, mod)
  ans %= mod
  #n-1Ci * (m-1)**i
  t *= (n-1-i)
  b *= (i+1)
print((ans*m%mod))

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

ans = 0
t = 1
b = 1
for i in range(k+1):
  ans += t * pow(m-1, n-1-i, mod) * pow(b, mod-2, mod)
  ans %= mod
  #n-1Ci * (m-1)**i
  t *= (n-1-i)
  t %= mod
  b *= (i+1)
  b %= mod
print((ans*m%mod))