import java.util.*; public class Main { static long MOD = (long)Math.pow(10, 9) + 7; public static void main(String[] args) { Scanner sc = new Scanner(System.in); long b = sc.nextLong() % MOD; long c = sc.nextLong() % MOD; long d = sc.nextLong(); long s = func(c, d + 1); s = (s + MOD - c) % MOD; long t = func(c - 1, MOD - 2); long ans = (s * t) % MOD; ans = (ans * b) % MOD; if(c == 1) ans = (b * (d % MOD)) % MOD; System.out.println(ans); } public static long func(long a, long x) { if(a == 0) return 0; if(x == 0) return 1; if(x % 2 == 0) { long t = func(a, x / 2); return (t * t) % MOD; } else { long t = func(a, (x - 1) / 2); t = (t * t) % MOD; return (a * t) % MOD; } } }