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