#include #include #include #include #define mod 1000000007 long int power(int x, unsigned long long int y) { long int temp,temp2,temp3; if( y == 0) return 1; temp = power(x, y/2); temp2 = ((temp%mod) * (temp %mod))%mod; if (y%2 == 0) return temp2; else{ temp3 = ((x%mod) * (temp2 %mod))%mod; return temp3; } } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ unsigned long long int t,i,cs; int a,b; scanf("%d%d%llu",&a,&b,&t); int r; r = (a+b)/2; /*for(i = 1; i <= t; i++){ cs = ((cs % mod)*(r%mod))%mod; }*/ cs = power(r,t); printf("%llu\n",cs); return 0; }