#include #include #include #include #include using namespace std; #define modul 1000000007 /* Iterative Function to calculate (x^y)%p in O(logy) */ int power(long long x,long long y, long p) { int res = 1; // Initialize result x = x % p; // Update x if it is more than or equal to p while (y > 0) { // If y is odd, multiply x with result if (y & 1) res = (res*x) % p; // y must be even now y = y>>1; // y = y/2 x = (x*x) % p; } return res; } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ long long t, cells; long long a, b; cin >> a >> b >> t; cout << power((a + b) / 2, t, modul) << endl; return 0; }