def inv(x): return pow(x, MOD-2, MOD) B, C, D = map(int, input().split()) MOD = 10 ** 9 + 7 print(((B * C * (pow(C, D, MOD) - 1)) % MOD) * inv(C-1) % MOD)