#include #include #include #include #include using namespace std; int main() { unsigned a, b; unsigned long long t; std::cin >> a >> b >> t; if (t == 0) { std::cout << 1 << std::endl; return 0; } unsigned long long step = (a + b) / 2; unsigned long long result = 1; while (t) { if (t & 1) { result *= step; result %= 1000000007; } step *= step; step %= 1000000007; t >>= 1; } std::cout << result << std::endl; return 0; }