# Enter your code here. Read input from STDIN. Print output to STDOUT abt = map(int,raw_input().strip().split(' ')) curr_sz=1 a = float(abt[0])*0.5 b = float(abt[1])*0.5 c = int(a+b) print int(pow(c,abt[2],10**9 + 7) % (10**9 + 7))