#include #define mod 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*base)%mod; exp >>= 1; base =(base* base)%mod; } return result; } int main() { long long int a,b,t,r1,r2; scanf("%lld%lld%lld",&a,&b,&t); r1=(a+b)/2; r1=ipow(r1,t); printf("%lld",r1%mod); return 0; }