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