def fast_power(a,n): """ This function assumes that n >= 0 """ result = 1 value = a power = n while power > 0: if power & 0x1: result = result * value result = result % 1000000007 value = value * value value = value % 1000000007 power = power//2 return result data = map(int, raw_input().split(' ')) a = data[0] b = data[1] t = data[2] answer = fast_power((a+b)/2, t) print int(answer)