#include #define rep(i,a,b) for(int i=a;i<(b);++i) #define erep(i,a,b) for(int i=a;i<=(int)(b);++i) #define per(i,a,b) for(int i=(a);i>(b);--i) #define eper(i,a,b) for(int i=(a);i>=b;--i) #define pb push_back #define mp make_pair #define INF (1<<31)-1 #define MOD 1000000007 #define all(x) (x).begin(),(x).end() #define vii vector #define vll vector using namespace std; typedef long long ll; typedef pair Pii; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b 0) { if ((y & 1)) res = res * x % MOD; x = x * x % MOD; y >>= 1; } return res % MOD; } int main() { cin.tie(0); ios::sync_with_stdio(false); cin >> b >> c >> d; ll ans = 0; c %= MOD; b %= MOD; if (c != 1) ans = (b * c) % MOD * (MOD + xpowy(c, d) - 1) % MOD * xpowy(c - 1, MOD - 2) % MOD; else ans = b % MOD * d % MOD; cout << ans << endl; return 0; }