from copy import deepcopy MOD = 10 ** 9 + 7 def solve(): m, n, c = map(int, input().split()) inv = pow(m, MOD - 2, MOD) % MOD # A_i, A_{i-1}, B_i, B_{i-1} B = [inv, 1, 0, 0] A = [[inv, 0, 0, inv], [1, 0, 0, 0], [0, (m - 1) * inv, inv, (m - 2) * inv], [0, 0, 1, 0]] n -= 1 while n: if n & 1: C = [0] * 4 for i in range(4): for j in range(4): C[i] += A[i][j] * B[j] C[i] %= MOD B = C.copy() n >>= 1 C = [[0] * 4 for _ in range(4)] for i in range(4): for j in range(4): for k in range(4): C[i][j] += A[i][k] * A[k][j] C[i][j] %= MOD A = deepcopy(C) ans = 1 - B[0] ans = pow(ans, c, MOD) print((1 - ans) % MOD) for _ in range(1): solve()