#include #include #include #define ll long long using namespace std; const ll MOD = 1000000007; ll magic(ll x,ll n){ // vraca x^n%MOD ll ret=1; while(n){ if (n&1) ret=ret*x%MOD; x=x*x%MOD; n/=2; } return ret; } int main() { ll a, b, t, sol; scanf("%lld%lld%lld", &a, &b, &t); sol = magic(((a+b)/2), t); printf("%lld\n", sol); return 0; }