'use strict'
function main(input) {
  input = input.trim().split('\n')
  input.shift()
  input = input.map(v => v.split(' ').map(w => w - 0))

  const field = {};
  const around = (a, b) => [[a - 1, b], [a + 1, b], [a, b - 1], [a, b + 1]]
  const isInside = arr => arr[0] >= 0 && arr[1] >= 0 && arr[0] < 101 && arr[1] < 101

  input.forEach(v => {
    if (!(v[0] in field)) field[v[0]] = {}
    if (!(v[1] in field[v[0]])) field[v[0]][v[1]] = {}
    if (!(v[2] in field[v[0]][v[1]])) field[v[0]][v[1]][v[2]] = 0
    field[v[0]][v[1]][v[2]] = 4
    const h = v[2] + 1
    around(...v).forEach(p => {
      if (isInside(p)) {
        if (!(p[0] in field)) field[p[0]] = {}
        if (!(p[1] in field[p[0]])) field[p[0]][p[1]] = {}
        if (!(h in field[p[0]][p[1]])) field[p[0]][p[1]][h] = 0
        field[p[0]][p[1]][h]++
      }
    })
  })
  let top = [-1, -1, -1, -1] // x, y, h, p
  for (let x in field) {
    for (let y in field[x]) {
      let max = [-1, -1]
      for (let h in field[x][y]) {
        if (max[1] < field[x][y][h]) {
          max = [h, field[x][y][h]]
        }
      }
      field[x][y] = max
      if (max[0] >= top[2] && max[1] > top[3]) {
        top = [x, y, ...max]
      }
    }
  }
  top.pop()
  console.log(top.join(' '))
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
