#include #include #include #include #include using namespace std; unsigned long long power(unsigned long long x, unsigned long long t){ if(t==0){ return 1; } else if(t==1){ return x%(1000000007); } else if(t%2==0){ return power((x*x)%(1000000007), t/2)%(1000000007); } else if(t%2==1){ return (x*power((x*x)%(1000000007), (t-1)/2))%(1000000007); } return 0; } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int a, b; unsigned long long t, c; cin >> a >> b >> t; c = power((a+b)/2, t)%1000000007; cout << c; return 0; }