#include #include #include #include #include using namespace std; typedef long long ll; const ll MOD = 1000000007; ll powmod(ll a, ll b) { ll pm = 1; while (b > 0) { if ((b & 1) != 0) pm = (pm * a) % MOD; a = (a * a) % MOD; b >>= 1; } return pm; } int main() { ll a, b, t; cin >> a >> b >> t; ll ans = powmod((ll)(a + b) / 2, t); printf("%lld\n", ans); return 0; }