# Enter your code here. Read input from STDIN. Print output to STDOUT a, b, t = map(int,raw_input().split(' ')) CONSTANT = (10**9) + 7 print pow((a+b)/2,t,CONSTANT)