a, b, t = map(int, input().split()) virus = 1 power = (a+b)//2 answer = int(pow(power, t, 10**9 + 7)) print(answer)