fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    val xyh = mutableListOf<Triple<Int, Int, Int>>()
    (1..N).forEach {
        val (x, y, h) = readLine()!!.split(" ").map { it.toInt() }
        xyh.add(Triple(x, y, h))
    }

    (0..100).forEach { cx ->
        (0..100).forEach { cy ->
            fun actualHeight(x: Int, y: Int, h: Int): Int {
                return Math.abs(x - cx) + Math.abs(y - cy) + h
            }

            val estimates = mutableListOf<Int>()
            val boundaries = mutableListOf<Int>()
            (0..(N - 1)).forEach {
                val (x, y, h) = xyh[it]
                if (h != 0) {
                    estimates.add(actualHeight(x, y, h))
                } else {
                    boundaries.add(actualHeight(x, y, 0))
                }
            }
            val h = estimates[0]
            var unique = true
            estimates.forEach {
                unique = unique && it == h
            }
            var valid = true
            boundaries.forEach {
                if (h > it) {
                    valid = false
                }
            }
            if (unique && h >= 1 && valid) {
                print(cx)
                print(' ')
                print(cy)
                print(' ')
                print(h)
                println("")
                return
            }
        }
    }
    println("Something is wrong")
}
