#include #include #include #include #include using namespace std; const int taskModulo = 1000'000'000 + 7; long long fastPow(long long base, long long n) { long long res = 1; while (n) { if (n & 1) res = (res * base) % taskModulo; base = base * base % taskModulo; n >>= 1; } return res; } int main() { long long a, b, t; cin >> a >> b >> t; long long base = (a + b) / 2; cout << fastPow(base, t) << endl; return 0; }