#include #include #include #include #include #define MOD 1000000007L using namespace std; typedef unsigned long long ull; ull pow(ull base, ull exp){ ull res = 1; while(exp > 0){ if(exp % 2 == 1){ res = res*base % MOD; } base = base*base % MOD; exp /= 2; } return res % MOD; } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ ull t, a, b; cin >> a >> b >> t; cout << pow((a+b)/2, t) <<'\n'; return 0; }