#include #include #include #define m 1000000007 using namespace std; long long mod(long long a, long long b) { return(a-(b*(a/b))); } long long pro(long long c,long long t) { unsigned long long t1,t2; if(t==0) return(1); else { if(t%2==0) return(mod(pro(c,t/2)*pro(c,t/2),m)); else return(mod(mod(c,m)*mod(pro(c,t/2)*pro(c,t/2),m),m)); } } int main() { long long a,b,t,amt,i,t1=0,c,d=1; scanf("%lld",&a); scanf("%lld",&b); scanf("%lld",&t); c=mod(mod(a,m)+mod(b,m),m)/2; d=pro(c,t); printf("%lld",d); return 0; }