#include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int a, b; long long t; cin >> a >> b >> t; long long s = (a + b)*0.5; long long arr[64]; arr[0] = s; //s % 1000000007; for (int i = 1; i < 64; ++i) arr[i] = (arr[i - 1] * arr[i - 1]) % 1000000007; long long count = 1; for (int i = 0; t > 0; ++i) { if ((t & 1) == 1) count = (count * arr[i]) % 1000000007; t >>= 1; } cout << (int)count << endl; return 0; }