
object Main extends App {
  import scala.io.StdIn._

  val n = readLine.trim.toInt
  val info = Array.tabulate(n){_ ⇒
    val Array(x, y, h) = readLine.trim.split(' ').map(_.toInt)
    Info(x, y, h)
  }
  println(
    (0 to 100).flatMap{x ⇒ (0 to 100).map{y ⇒ Coordinate(x, y)}}.find{center ⇒
      info.map(i ⇒ inverseHeight(center, i)).let{a ⇒
        a.find{
          case Equal(_) ⇒ true
          case _ ⇒ false
        } match {
          case Some(Equal(height)) ⇒ a.forall{
            case Equal(h) ⇒ height == h
            case Lower(h) ⇒ height <= h
          }
          case _ ⇒ a.forall{
            case Lower(h) ⇒ 1 <= h
            case _ ⇒ false
          }
        }
        }
    }.get.let(center ⇒ s"${center.x} ${center.y} ${info.map(inverseHeight(center, _)).find(_.isInstanceOf[Equal]).let(it ⇒ if (it.isDefined) it.get else Equal(1)).asInstanceOf[Equal].height}")
  )
  def inverseHeight(center: Coordinate, info: Info): Either = {
    info match {
      case Info(x, y, 0) ⇒ Lower((center.x - x).abs + (center.y - y))
      case Info(x, y, h) ⇒ Equal(h + (center.x - x).abs + (center.y - y).abs)
    }
  }
  sealed trait Either
  case class Lower(height: Long) extends Either
  case class Equal(height: Long) extends Either
  implicit class RichInt(val value: Long){
    def abs: Long = if (value >= 0) value else -value
  }
  case class Coordinate(x: Int, y: Int)
  case class Info(x:Int, y:Int, h:Long)
  implicit class ScopeFunc[T](value: T){
    def let[A](func: T ⇒ A): A = func(value)
    def also(func: T ⇒ Unit): T = {
      func(value)
      value
    }
  }
}