line = [int(i) for i in input().strip().split(' ')] a = line[0] b = line[1] t = line[2] expected_growth = (a + b) / 2 expected_size = 1 for i in range(t): expected_size = (expected_size * expected_growth) % (10 ** 9 + 7) print (str(int(expected_size)))