MOD = 10 ** 9 + 7 b, c, d = map(int, input().split()) if c % MOD == 1: print((b * d) % MOD) else: ans = pow(c - 1, MOD - 2, MOD) * b * c * (pow(c, d, MOD) - 1) % MOD print(ans)