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