a, b, t = map(int, input().split()) result = (0.5 * (a + b)) something = (10 ** 9 + 7) print(int(pow(int(result), int(t), something)))