a, b, time = (int(x) for x in input().strip().split()) c = int((a + b) * 0.5) rem = 10 ** 9 + 7 print(pow(c, time, rem))