#include using namespace std; int fun(long long int x,long long int n) { long long int m=1000000007; long long int ans =1; while(n>0) { if(n%2==1){ ans=(ans*x)%m; } x=(x*x)%m; n=n/2; } return ans; } int main() { int a,b; long long int i,t,ans; cin>>a>>b>>t; ans = ((long long int)(0.5*a*1+0.5*b*1))%1000000007; ans=fun(ans,t); cout<