#include using namespace std; typedef long long LL; typedef double dbl; #define all(x) (x).begin(), (x).end() #ifdef _DEBUG # define LOG(x...) fprintf(stderr, x) #else # define LOG(x...) 0 #endif const int INF = 1000000000; const int MOD = 1000000007; const dbl EPS = 1e-9; int binpow(int a, LL p) { if (p == 0) return 1; if (p == 1) return a; if (p & 1) return a * 1ll * binpow(a * 1ll * a % MOD, p / 2) % MOD; return binpow(a * 1ll * a % MOD, p / 2); } int main() { #ifdef _DEBUG freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif cin.tie(0); cin.sync_with_stdio(0); int a, b; LL t; cin >> a >> b >> t; a += b; a /= 2; cout << binpow(a, t) << endl; return 0; }