a,b,t = [int(x) for x in input().split(' ')] mod = 1000000007 factor = int((a+b)/2) population = pow(factor, t, mod) print(population)