#include using namespace std; #define ll long long const int M = 1e9 + 7; ll bin_pow(ll a, ll n) { if (n == 0) return 1; if (n % 2 == 0) return bin_pow((a * a) % M, n / 2); return (a * bin_pow((a * a) % M, n / 2)) % M; } int main() { ll a, b, t; cin >> a >> b >> t; cout << bin_pow((a + b) / 2, t) << endl; return 0; }