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