#include #define MOD 1000000007 typedef long long ll; typedef unsigned long long ull; using namespace std; ll Pow(ll a,ll x) { if (!x) return 1; if (x==1) return a; ll tmp=Pow(a,x>>1LL); tmp=(tmp*tmp)%MOD; return (x&1LL)?(tmp*a)%MOD:tmp; } int main() { ll a,b,t; scanf("%lld%lld%lld",&a,&b,&t); ll tmp=(a+b)>>1LL; printf("%lld",Pow(tmp,t)); }