a, b, t = map(int, input().split()) assert (a + b) % 2 == 0 g = int(.5 * (a + b)) m = 10**9 + 7 r = 1 for _ in range(t): r *= g r %= m print(r)