a,b,t = map(int, input().split()) probA = 0.5 * a probB = 0.5 * b growth = (probA + probB) * 1 print(pow(int(growth), t, 10**9+7))