#include #include #include #include #include using namespace std; long long mod_pow(long long a, long long b, long long n) { a %= n; long long res = 1; while (b > 0) { if (b & 1) res = (res * a) % n; a = (a * a) % n; b >>= 1; } return res; } int main() { long long a, b, t; long long n = 1000000007; scanf("%lld%lld%lld", &a, &b, &t); printf("%lld\n", mod_pow((long long)(0.5 * (a + b)), t, n)); return 0; }