#include #include #include #include #define M 1000000007 long long int ipow(long long int base,long long int exp) { long long int result = 1; while (exp) { if (exp & 1) result =(result%M* base%M)%M; exp >>= 1; base=((base%M)* (base%M))%M; } return result; } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ long long int a,b,t,x,ans,c; scanf("%lld%lld%lld",&a,&b,&t); c=(a+b)/2; ans=ipow(c,t)%M; printf("%lld\n",ans); return 0; }