#include #include #include #include int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int a,b,c; long int i,t,ans=1,d; scanf("%d%d%ld",&a,&b,&t); if(a<1||a>100) scanf("%d",&a); if(b<1||b>100) scanf("%d",&b); if(t<1||t>pow(10,18)) scanf("%ld",&t); d=pow(10,9)+7; for(i=1;i<=t;i++) ans=ans*0.5*a+ans*0.5*b; ans=(int)ans % d; printf("%ld",ans); return 0; }