import sys input = [] n = 1 for line in sys.stdin: for s in line.split(' '): input.append(int(s)) print pow(int(0.5*(input[0]+input[1])),input[2],(10**9 + 7))