#inputs a, b, t = [int(i) for i in input().split()] avg = int((a+b)/2) m = (10**9)+7 #generate table table = [avg] for i in range(64): table.append((table[i]**2)%m) #[print(i) for i in table] tb = bin(t)[2:][::-1] #print(tb) out = 1 for i in range(len(tb)): if tb[i] == '1': out = (out*table[i])%m print(out)