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