let N = Int(readLine()!)!

var input: [[Int]] = []
for _ in 1 ... N {
    let i = readLine()!.characters.split(" ").map{Int(String($0))!}
    input.append(i)
}

let xs = (0...N - 1).map { input[$0][0] }
let ys = (0...N - 1).map { input[$0][1] }

func H(x: Int, y: Int, h: Int, Cx: Int, Cy: Int) -> Int {
    let elem_x: Int = x - Cx > 0 ? x - Cx : Cx - x
    let elem_y: Int = y - Cy > 0 ? y - Cy : Cy - y
    
    return max(h + elem_x + elem_y, 0)
}

var cx: Int = 0
var cy: Int = 0
loop: for Cx in 0...100 {
    for Cy in 0...100 {
        let h = H(input[0][0], y: input[0][1], h: input[0][2], Cx: Cx, Cy: Cy)
        var found: Bool = true
        for i in 1 ... N - 1 {
            let hi = H(input[i][0], y: input[i][1], h: input[i][2], Cx: Cx, Cy: Cy)
            if h != hi {
                found = false
                break
            }
        }
        if found {
            cx = Cx
            cy = Cy
            break loop
        }
    }
}

let h = H(input[0][0], y: input[0][1], h: input[0][2], Cx: cx, Cy: cy)
print("\(cx) \(cy) \(h)")
