# Enter your code here. Read input from STDIN. Print output to STDOUT a, b, t = map(int, raw_input().split()) print (pow((a+b)/2,t,1000000007))%(1000000007)