integer N,Q
integer,allocatable,dimension(:)::S,T,X
integer num
integer ans
read*,N,Q
allocate(S(N),T(N),X(N))
do i=1,N
  read*,S(i),T(i),X(i)
end do
do i=1,Q
  read*,num
  ans=huge(ans)
  do j=1,N
    if(S(j)-X(j)<=num.and.num < T(j)-X(j))then
      ans=min(ans,X(j))
    endif
  end do
  if(ans==huge(ans))ans=-1
  
  print"(i0)",ans
end do
end