fun main(array: Array<String>) = abc112c()

fun abc112c() {
    data class Coordinate(val x: Long, val y: Long, val h: Long) {
        override fun toString() = "$x $y $h"
    }

    val n = readLine()!!.toInt()
    val coordinates = Array(n) {
        val (x, y, h) = readLine()!!.split(' ').map { it.toLong() }
        Coordinate(x, y, h)
    }.filter { it.h > 0 }

    if (coordinates.size == 1) return println(coordinates.first())

    val answer = (0..100L).map { y ->
        (0..100L).map { x ->
            coordinates.map { it.h + Math.abs(x - it.x) + Math.abs(y - it.y) }.distinct()
                .let { if (it.size == 1) Coordinate(x, y, it.first()) else null }
        }
    }.flatten().filterNotNull().firstOrNull() ?: error("なんで？")

    println(answer)
}
