let args = readLine()!.characters.split(" ").map({Int(String($0))!}) let a = args[0] let b = args[1] let t = args[2] let modulo = 1000000007 func pow(x: Int, _ y: Int) -> Int { var x = x var y = y var result = 1 x = x % modulo while y > 0 { if y % 2 == 1 { result = (result * x) % modulo } y /= 2 x = (x * x) % modulo } return result } let expectedValue = pow((a + b) / 2, t) print(expectedValue)