#include #include #include #include long long int power(long long int x, long long int y,long long int p) { long long int res = 1; x = x % p; while (y > 0) { if (y & 1) res = (res*x) % p; y = y>>1; x = (x*x) % p; } return res; } int main() { int a,b; long long int t,c,d,e,f,g,p; scanf("%d",&a); scanf("%d",&b); scanf("%lld",&t); c=(a+b)/2; p=pow(10,9)+7; d=power(c,t,p); printf("%lld\n",d); return 0; }