#include #include #include #include #include using namespace std; int main() { int a; int b; unsigned long long t; cin >> a; cin >> b; cin >> t; int p = 1000000007; unsigned long long c = 1; unsigned long long base = 0.5*a+0.5*b; base = base % p; while (t > 0) { if (t & 1){ c = (c*base) % p; } //cout << "c: " << c << endl; t = t>>1; //cout << "t: " << t << endl; base = (base*base) % p; //cout << "base: " << base << endl; } cout << c; return 0; }