#include #include #include #include #include #include #include #include #include using namespace std; #define pb push_back #define sz(a) (int)a.size() #define fs first #define sc second typedef long long ll; typedef pair ii; const int MOD = 1000000007; ll a, b, t; ll mu(ll a, ll b) { if (b==0) return 1; ll k = mu(a,b/2); k = k*k%MOD; return (b&1?k*a%MOD:k); } int main() { //freopen("input.txt","r",stdin); cin >> a >> b >> t; cout << mu((a+b)/2,t) << endl; return 0; }