a, b, t = [int(n) for n in input().strip().split(' ')] n = 10 ** 9 + 7 r = pow((a + b) // 2, t, n) print(r)