#include #include #include #include unsigned long long powermod(unsigned long long base, unsigned long long exponent, unsigned long long modulus) { unsigned long long result = 1; while (exponent > 0) { if ((exponent % 2)) { result = (result * base) % modulus; } base = (base * base) % modulus; //exponent = floor(exponent / 2); exponent = exponent / 2; } return result; } int main() { int a, b; unsigned long long c; scanf("%d %d %lld\n", &a, &b, &c); unsigned long long factor = (unsigned long long)(a+b)/2; unsigned long long cells = powermod(factor, c, 1000000007); printf("%lld", cells); return 0; }