#include using namespace std; const long long MOD = 1000000007; long long modpow(long long a, long long b){ long long ans = 1; while (b > 0){ if (b % 2 == 1){ ans *= a; ans %= MOD; } a *= a; a %= MOD; b /= 2; } return ans; } long long modinv(long long a){ return modpow(a, MOD - 2); } vector> matmul(vector> A, vector> B){ int N = A.size(); vector> ans(N, vector(N, 0)); for (int i = 0; i < N; i++){ for (int j = 0; j < N; j++){ for (int k = 0; k < N; k++){ ans[i][k] += A[i][j] * B[j][k]; ans[i][k] %= MOD; } } } return ans; } vector> matexp(vector> A, long long b){ int N = A.size(); vector> ans(N, vector(N, 0)); for (int i = 0; i < N; i++){ ans[i][i] = 1; } while (b > 0){ if (b % 2 == 1){ ans = matmul(ans, A); } A = matmul(A, A); b /= 2; } return ans; } int main(){ int C, N, M; cin >> C >> N >> M; long long P = modinv(C); vector> A(4, vector(4, 0)); A[0][0] = P; A[1][1] = P; A[0][3] = MOD + 1 - P; A[1][2] = P; A[1][3] = MOD + 1 - P * 2 % MOD; A[2][0] = 1; A[3][1] = 1; A = matexp(A, N); long long S = MOD + 1 - A[0][0]; S = modpow(S, M); cout << (MOD + 1 - S) % MOD << endl; }