#include long long int power(long long int x, long long int y, long long int p) { long long 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; } // Driver program to test above functions int main() { long long int a,b; long long int t; long long int answer=0; long long int bb,two; scanf("%lld",&a); scanf("%lld",&b); scanf("%lld",&t); long long int m = 1e9+7; answer=power((a+b)/2, t,m) ; printf("%lld", answer); return 0; }