a, b, t = map(int, input().split(" ")) mod = 1000000007 print(pow(int((a + b) / 2), t, mod))