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