#include #include #include #include #include using namespace std; const uint64_t modulo = 1000000007; uint64_t power(uint64_t x, uint64_t y) { uint64_t res = 1; x = x % modulo; while (y > 0) { if (y & 1) res = (res*x) % modulo; y = y>>1; x = (x*x) % modulo; } return res; } int main() { int a, b; uint64_t t; cin >> a >> b >> t; int scale = (a+b)/2; uint64_t result = power(scale, t); result = result % modulo; cout << result; return 0; }