# Enter your code here. Read input from STDIN. Print output to STDOUT IN = raw_input().split() ans = pow(int((0.5 *(int(IN[0]) + int(IN[1])))),int(IN[2]),1000000007) print (int(ans))