n = gets.chomp.to_i
list, zeros = n.times.map { gets.chomp.split(' ').map(&:to_i) }.partition { |nums| nums[2] != 0 }

targets = []

0.upto(100).each do |x|
  0.upto(100).each do |y|
    ch = -1
    result = list.all? do |nums|
      x1, y1, h1 = nums
      ch_tmp = h1 + (x1 - x).abs + (y1 - y).abs
      if ch == -1
        ch = ch_tmp
        true
      else
        ch == ch_tmp
      end
    end
    targets << [x, y, ch] if result
  end
end

if targets.size == 1
  x, y, h = targets[0]
  puts "#{x} #{y} #{h}"
  exit
end

answer = targets.find do |nums|
  x, y, h = nums
  zeros.all? do |zero_nums|
    x1, y1, _h = zero_nums
    (h - (x - x1).abs - (y - y1).abs) <= 0
  end
end
x, y, h = answer
puts "#{x} #{y} #{h}"
