#include #include #include #include long long power(long long x, unsigned long long y, long long p) { long long 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() { int a,b; long long p; unsigned long long t; scanf("%d %d %lld", &a, &b, &t); p=power((a+b)/2,t,1000000007); printf("%lld",p); return 0; }