class Integer def mod_pow(n, mod) x = self res = 1 while n > 0 res = res * x % mod if n[0] == 1 x = x * x % mod n >>= 1 end res end def mod_inverse(mod) mod_pow(mod - 2, mod) end end B, C, D = gets.split.map(&:to_i) MOD = 10 ** 9 + 7 S = if C == 1 C * D else C * (C.pow(D, MOD) - 1) * (C - 1).mod_inverse(MOD) end puts (B * S) % MOD