#include #include #include #include #include using namespace std; long long modpow(long long, long long, long long); int main() { int a, b; long long ms; long long cells = 1; cin >> a; cin >> b; cin >> ms; cells = modpow((a + b)/2, ms, 1000000007); cout << cells; return 0; } long long modpow(long long base, long long exp, long long modulus) { base %= modulus; long long result = 1; while (exp > 0) { if (exp & 1) result = (result * base) % modulus; base = (base * base) % modulus; exp >>= 1; } return result; }