# 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,10**9+7)