fun main(args: Array<String>) {
    val N = readLine()!!.toInt()

    val x = LongArray(N) { 0L }
    val y = LongArray(N) { 0L }
    val h = LongArray(N) { 0L }

    for (i in 0 until N) {
        val (X, Y, H) = readLine()!!.split(" ").map { it.toLong() }
        x[i] = X
        y[i] = Y
        h[i] = H
    }

    fun check(cx: Long, cy: Long, H: Long): Boolean {
        if (h.max()!! > H) return false

        for (i in x.indices) {
            if (h[i] != Math.max(H - Math.abs(x[i] - cx) - Math.abs(y[i] - cy), 0L)) {
                return false
            }
        }

        return true
    }

    val mx = h.sorted().last()
    val idx = h.indexOf(mx)

    for (a in 0..100) {
        for (b in 0..100) {
            val dx = Math.abs(a - x[idx])
            val dy = Math.abs(b - y[idx])

            val ch = h[idx] + dx + dy

            if (check(a.toLong(), b.toLong(), ch)) {
                println("$a $b $ch")

                return
            }
        }
    }
}
