#include #include #include #include #include using namespace std; int main() { long long t, a, b; cin >> a >> b >> t; long long p = (a + b) / 2; long long mod = 1000*1000*1000 + 7; long long retval = 1; long long power = p; while (t > 0) { if ((t % 2) == 1) retval = (retval * power) % mod; power = (power * power) % mod; t /= 2; } std::cout << retval; return 0; }