#include using namespace std; long power(long x, long y, long 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 a, b, t; cin >> a >> b >> t; long value = (long)((a + b) / (long)2); long output = power(value, t, 1000000007); cout << output; return 0; }