#include #include #include #include #include using namespace std; unsigned long long PowByMod (size_t d, unsigned long long t, size_t modulo) { unsigned long long mod_res = 1; while (t) { if (t % 2 == 0) { t /= 2; d = (d * d) % modulo; } else { t--; mod_res = (mod_res * d) % modulo; } } return mod_res; } int main () { size_t a; size_t b; std::cin >> a >> b; size_t d = 0.5 * (a + b); unsigned long long t; std::cin >> t; size_t modulo_value = 1000000007; unsigned long long answer = PowByMod (d, t, modulo_value); std::cout << answer; return 0; }