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