#include #include #include #include #include using namespace std; int main() { uint64_t a, b, c, t, p = 1000000007, z = 1; cin >> a >> b >> t; // (c/2)^t % p = (c/2 % p)*(c/2 % p) for(c = (a+b)/2; t > 0; t >>= 1) { if(t&1) { z = (c*z) % p; } c = (c*c) % p; } cout << z << endl; return 0; }