program main
integer :: n,cx,cy
integer,allocatable :: x(:),y(:),h(:),hx(:)
integer :: k
read(*,*)n
allocate(x(n),y(n),h(n),hx(n))
do k=1,n
	read(*,*)x(k),y(k),h(k)
end do


loop1:do cx=0,100
	do cy=0,100
		do k=1,n
        	hx(k) = h(k) +abs(x(k)-cx)+abs(y(k)-cy)
        end do
        if (maxval(hx) == minval(hx)) then
        	exit loop1
        end if
    end do
end do loop1

write(*,'(i0,x,i0,x,i0)')cx,cy,hx(1)
end program