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