fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val (x, y, h) = Triple(IntArray(n), IntArray(n), IntArray(n))
    for (i in 0 until n) {
        val (xt, yt, ht) = readLine()!!.split(' ').map(String::toInt)
        x[i] = xt
        y[i] = yt
        h[i] = ht
    }
    for (xi in 0..100) {
        for (yi in 0..100) {
            var top = 0
            var flag = true
            for (i in 0 until n) {
                if (h[i] != 0) top = h[i] + Math.abs(x[i] - xi) + Math.abs(y[i] - yi)
            }
            for (i in 0 until n) {
                if (h[i] != Math.max(top - Math.abs(x[i] - xi) - Math.abs(y[i] - yi), 0)) {
                    flag = false
                }
            }
            if (flag) {
                println("$xi $yi $top")
                return
            }
        }
    }
}