#include #include #include #define f first #define s second using namespace std; long long power(long long val, long long time) { if(time == 0) return 1; if(time % 2 == 0) { long long ans = power(val, time / 2); ans = ans % 1000000007; ans = ans * ans; ans = ans % 1000000007; return ans; }else{ long long ans = val * power(val, time - 1); ans = ans % 1000000007; return ans; } } int main(){ long long a,b,t; cin >> a >> b >> t; long long val = (a + b) / 2; long long ans = power(val, t); cout << (ans % 1000000007) << endl; return 0; }