(a,b,t) = tuple([int(x) for x in input().split()]) E = 1 for ms in range(1,t+1): E = ((((a+b) / 2)*E)%(1000000007)) print(int(E))