import math, sys def power(x,y,p): res=1 x = x%p while (y>0): if (y & 1): res = (res*x) %p y = y>>1 x =(x*x)%p return res def func(a,b,t): mod = 1000000007 k = (a+b)/2 #tot = power(k,t, mod) tot = pow(k,t,mod) return tot for line in sys.stdin: a,b,t = [int(i) for i in line.strip().split()] print(pow(int((a+b)/2),t,1000000007))