#include #include #include #include #include #define ll long long using namespace std; ll modular_pow(ll base, ll exponent, ll modulus) { ll result = 1; while (exponent > 0) { if (exponent % 2 == 1) result = (result * base) % modulus; exponent = exponent >> 1; base = (base * base) % modulus; } return result; } int main() { int a,b; unsigned long long int t; cin>> a>>b>>t; float p = (a+b)*0.5; printf("%lld",modular_pow(p,t,1000000007)); return 0; }