program pyramid
  implicit none
  integer :: n, x(100) = 0, y(100) = 0, h(100) = 0, i
  integer :: cx, cy, ch, mx, my, mh = -1
  read(*,*) n
  do i = 1, n
    read(*,*) x(i), y(i), h(i)
    if (mh < h(i)) then
      mx = x(i)
      my = y(i)
      mh = h(i)
    end if
  end do
  do cx = 0, 100
    do cy = 0, 100
      ch = mh+abs(mx-cx)+abs(my-cy)
      do i = 1, n
        if (max(ch-abs(cx-x(i))-abs(cy-y(i)),0) /= h(i)) goto 100
      end do
      write(*,'(i0,x,i0,x,i0)') cx, cy, ch
      stop
100 end do
  end do
end program pyramid