# Enter your code here. Read input from STDIN. Print output to STDOUT x,y,t= map(int, raw_input().strip().split(' ')) x=int(x) y=int(y) t=int(t) t=t%1000000006 k=(x+y)/2 def power(x,y): if y == 0: return 1; temp = power(x, y/2)%1000000007; if y%2 == 0: return temp*temp%1000000007; else: return x*temp*temp%1000000007; print power(k,t)