#include #include #include #include #include using namespace std; //x^n=((x^2)^n/2) n is even //x^n=x*((x^2)^(n-1/2)) n is odd int main() { int a,b; long long t,n=1; cin>>a>>b>>t; long x=(a+b)/2; long z=10*10*10*10*10*10*10*10*10+7; while(t>0) { if(t&1)//if t is odd { n=n*x% z ; } t>>=1; x=x*x%z; } cout<