#include #include #include #include #include #define mod 1000000007 using namespace std; long long powerx(long long A, long long P) { long long ans = 1; while(P) { if(P%2==1) ans = (A*ans)%mod; A = (A*A)%mod; P/=2; } return ans; } int main() { int a, b; scanf("%d %d", &a, &b); long long t, m; scanf("%lld", &t); m = (a+b)/2; cout << powerx(m, t); return 0; }