#include #include #include #include #include using namespace std; #define ull unsigned long long int; unsigned long long int myPower(unsigned long long int x, unsigned long long int y) { unsigned long long int res = 1; while (y > 0) { if (y%2 == 1) res = (res*x) % 1000000007; y = y / 2; x *= x; x = x % 1000000007; } return res; } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int a, b; cin >> a >> b; unsigned long long int t, last = 0, t2; cin >> t; int x = (a + b) / 2; last = myPower(x, t); cout << last % 1000000007 << endl; return 0; }