fun main(args: Array<String>?): Unit {
    val n = readLine()!!.trim().toInt()
    val memo = Array(101){Array(101){ Suspect.Less(Int.MAX_VALUE) as Suspect }}
    repeat(n){
        val (x, y, h) = readLine()!!.trim().split(' ').map(String::toInt)
        for (cx in 0 .. 100) for (cy in 0 .. 100) if (memo[cx][cy] != Suspect.Nothing) {
            val suspect = memo[cx][cy]
            val distance = Math.abs(x - cx) + Math.abs(y - cy)
            if (h == 0) {
                when(suspect) {
                    is Suspect.Less -> {
                        if (suspect.height > distance) {
                            memo[cx][cy] = Suspect.Less(distance)
                        }
                    }
                    is Suspect.Just -> {
                        if (suspect.height > distance) {
                            memo[cx][cy] = Suspect.Nothing
                        }
                    }
                    else -> {}
                }
            }else {
                when(suspect) {
                    is Suspect.Less -> {
                        if (suspect.height >= distance + h) {
                            memo[cx][cy] = Suspect.Just(distance + h)
                        }else {
                            memo[cx][cy] = Suspect.Nothing
                        }
                    }
                    is Suspect.Just -> {
                        if (suspect.height != distance + h){
                            memo[cx][cy] = Suspect.Nothing
                        }
                    }
                    else -> {}
                }
            }
        }
    }
    for (cx in 0 .. 100) for (cy in 0 .. 100) if (memo[cx][cy] is Suspect.Just) {
        println("$cx $cy ${(memo[cx][cy] as Suspect.Just).height}")
        return
    }
    for (cx in 0 .. 100) for (cy in 0 .. 100) if (memo[cx][cy] is Suspect.Less) {
        println("$cx $cy ${(memo[cx][cy] as Suspect.Less).height}")
        return
    }
    TODO()
}
sealed class Suspect {
    object Nothing : Suspect()
    class Less(val height: Int) : Suspect()
    class Just(val height: Int): Suspect()
}