#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; void runOne() { constexpr uint64_t M = 1e9 + 7; uint64_t a, b; cin >> a >> b; uint64_t t; cin >> t; uint64_t c = (a + b) >> 1; uint64_t res = 1; uint64_t acc = c; for (uint64_t i = 0; i < 64; ++i) { if (t & (1ull << i)) { res *= acc; res %= M; } acc = acc * acc; acc %= M; } cout << res << endl; } int main(int, char**) { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(NULL); size_t t = 1; //cin >> t; while (t--) runOne(); return 0; }