#include #include #include #include int main() { long a, b, t; scanf("%li %li %li", &a, &b, &t); long modulo = pow(10, 9)+7; long result = 1; long base = (a+b)/2; while (t > 0) { if (t % 2 == 1) result = (result * base) % modulo; t >>= 1; base = (base * base) % modulo; } printf("%li", result); return 0; }