#include #include #include #include #include using namespace std; long long hugePow(long long pow, int base) { long long modulo = 1000000007; // in case power has been cut down to 0 if (pow == 0) return 1; // Memo -> leads to O(log(n)) complexity long long temp = hugePow(pow/2, base)%modulo; // If power is even if (pow%2 == 0) return (temp*temp)%modulo; // If power is odd else return (((temp*temp)%modulo)*base)%modulo; } int main() { int a, b; long long t; cin >> a >> b >> t; int base = (a+b)/2; long long ans = hugePow(t, base); cout << ans << endl; return 0; }