program abc112c
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: n,i,cx,cy,ph,xx,yy,hh
    integer(int32), allocatable:: x(:),y(:),h(:)
    logical:: ok

    read*, n
    allocate(x(n), y(n), h(n))
    xx=0; yy=0; hh=0
    do i=1,n
        read*, x(i),y(i),h(i)
        if (h(i) /= 0) then
            xx=x(i); yy=y(i); hh=h(i)
        end if
    end do
    ph = -1
    do cy=0,100
        do cx = 0,100
            ph = hh + abs(xx-cx) + abs(yy-cy)
            ok = .true.
            do i=1,n
                if (h(i) /= max(ph - abs(x(i)-cx) - abs(y(i)-cy), 0)) ok=.false.
            end do
            
            if (ok) then
                print'(*(i0,1x))', cx,cy,ph
                stop
            end if
        end do
    end do
end program abc112c