# Enter your code here. Read input from STDIN. Print output to STDOUT # Enter your code here. Read input from STDIN. Print output to STDOUT import math p=int(math.pow(10,9)+7) def power(x,y,p): res = 1; x = x % p; while (y > 0): if (y %2 == 1): res = (res*x) % p y= y/2 x = (x*x) % p return res c=raw_input().split() for i in range(0,3): a=int(c[0]) b=int(c[1]) t=int(c[2]) ans=power((a+b)/2,t,p) print int(ans)