#!/bin/python3 import sys def findLargestPowerOf2(x): tempValue = 1 numberOfTwos = 0 while((tempValue*2) <= x ): tempValue *= 2 numberOfTwos += 1 return numberOfTwos a,b,t = input().strip().split(' ') a,b,t = [int(a),int(b),int(t)] modValue = 1000000007 growthRate = (a + b) // 2 totalGrowth = 1 while t > 0: if t >= 4: powerOf2 = findLargestPowerOf2(t) t -= 2**powerOf2 currentGrowth = growthRate for x in range(powerOf2): currentGrowth = currentGrowth**2 % modValue totalGrowth *= currentGrowth % modValue if t < 4: if(totalGrowth > 1) : totalGrowth *= growthRate**t % modValue else : totalGrowth = growthRate**t % modValue t -= t print(totalGrowth % modValue)