def pow (x,t) if t==0 return 1 end temp=pow(x,t/2) if t%2==0 return temp*temp% (1000000007) else return x*temp*temp% (1000000007) end end a,b,t=gets.strip.split(" ").map(&:to_i) x=(a+b)*0.5 x=x.round ans=pow(x,t) print ans