import sys from decimal import * a,b,t = [int(k) for k in input().strip().split()] num = 0.5 * (a+b) ## p = ((0.5*(a+b))**t) % (10**9 + 7) mod = 10**9 + 7 ## print(mod) p = getcontext().power(Decimal(num), Decimal(t), Decimal(mod)) print(p)