Buggy python submission (verdict: Time Limit Exceeded):
def inv(a, mod):
    b = mod
    p, q = 1, 0
    while b > 0:
        c = a//b
        d = a; a = b; b = d % b
        d = p; p = q; q = d-c*q
    return p+mod if p < 0 else p

def comb(n, r, mod):
    if n < 0 or r < 0 or r > n: return 0
    nu = 1
    de = 1
    for i in range(r):
        nu = nu * (n-i) % mod
        de = de * (i+1) % mod
    return nu * inv(de, mod) % mod


lim=998244353
n,m,k=map(int,input().split())
def f(n,k):
    ans = m %lim
    ans = (ans *pow(m-1,n-k-1,lim)) % lim
    ans = (ans * comb(n-1,k,lim)) % lim
    return ans

#n,m,k = 60522, 114575, 7559
sum_ = 0
for j in range(k+1):
    ans = m %lim
    #print(m-j-1,n,j)
    ans = (ans *pow(m-1,n-j-1,lim)) % lim
    ans = (ans * comb(n-1,j,lim)) % lim
    #print(ans)
    sum_ = (sum_+ans) % lim
print(sum_)

Fixed submission:
class Combination():
    def __init__(self, n, mod):
        self.n = n
        self.mod = mod
        self.fact = self.make_fact(n)
        self.fact_inv = self.make_fact_inv(n)
    def make_fact(self, n):#0~nの階乗を求める
        res = [1]*(n+1)
        for i in range(1, n+1):
            res[i] = res[i-1]*i%self.mod
        return res
    def make_fact_inv(self, n):#0~nの階乗のmodに関する逆元を求める
        fact_inv = [1]*(n+1)
        fact_inv[n] = pow(self.fact[n], self.mod-2, self.mod)#フェルマーの小定理
        for i in range(n, 0, -1):
            fact_inv[i-1] = fact_inv[i]*i%self.mod
        return fact_inv
    def comb(self, m, k):
        return self.fact[m]*self.fact_inv[k]*self.fact_inv[m-k]%self.mod
    


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

#n,m,k = 60522, 114575, 7559
sum_ = 0
comb=Combination(n,lim)
for j in range(k+1):
    ans = m %lim
    #print(m-j-1,n,j)
    ans = (ans *pow(m-1,n-j-1,lim)) % lim
    ans = (ans * comb.comb(n-1,j)) % lim
    #print(ans)
    sum_ = (sum_+ans) % lim
print(sum_)

Buggy python submission (verdict: Runtime Error):
lim=998244353
n,m,k=map(int,input().split())
def f(n,k):
    ans = m %lim
    ans = (ans *pow(m-1,n-k-1,lim)) % lim
    ans = (ans * comb(n-1,k,lim)) % lim
    return ans

#n,m,k = 60522, 114575, 7559
sum_ = 0
for j in range(k+1):
    ans = m %lim
    #print(m-j-1,n,j)
    ans = (ans *pow(m-1,n-j-1,lim)) % lim
    ans = (ans * comb(n-1,j,lim)) % lim
    #print(ans)
    sum_ = (sum_+ans) % lim
print(sum_)

Fixed submission:
class Combination():
    def __init__(self, n, mod):
        self.n = n
        self.mod = mod
        self.fact = self.make_fact(n)
        self.fact_inv = self.make_fact_inv(n)
    def make_fact(self, n):#0~nの階乗を求める
        res = [1]*(n+1)
        for i in range(1, n+1):
            res[i] = res[i-1]*i%self.mod
        return res
    def make_fact_inv(self, n):#0~nの階乗のmodに関する逆元を求める
        fact_inv = [1]*(n+1)
        fact_inv[n] = pow(self.fact[n], self.mod-2, self.mod)#フェルマーの小定理
        for i in range(n, 0, -1):
            fact_inv[i-1] = fact_inv[i]*i%self.mod
        return fact_inv
    def comb(self, m, k):
        return self.fact[m]*self.fact_inv[k]*self.fact_inv[m-k]%self.mod
    


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

#n,m,k = 60522, 114575, 7559
sum_ = 0
comb=Combination(n,lim)
for j in range(k+1):
    ans = m %lim
    #print(m-j-1,n,j)
    ans = (ans *pow(m-1,n-j-1,lim)) % lim
    ans = (ans * comb.comb(n-1,j)) % lim
    #print(ans)
    sum_ = (sum_+ans) % lim
print(sum_)