using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static long[] NList => ReadLine().Split().Select(long.Parse).ToArray(); public static void Main() { var a = NList; var mod = 1_000_000_007; var b = a[0] % mod; var c = a[1] % mod; var d = a[2] % mod; if (c == 1) { WriteLine(b * d % mod); } else { var x = b * c % mod * Exp(c - 1 + mod, mod - 2, mod) % mod; WriteLine((Exp(c, a[2], mod) * x % mod - x + mod) % mod); } } static long Exp(long n, long p, int mod) { long _n = n % mod; var _p = p; var result = 1L; if ((_p & 1) == 1) result *= _n; while (_p > 0) { _n = _n * _n % mod; _p >>= 1; if ((_p & 1) == 1) result = result * _n % mod; } return result; } }