a,b,t = [int(i) for i in input().split()] print(int(pow(int(0.5*(a+b)), t, 1000000007)))