integer N,Q
integer S,T,X
integer distance(0:10**8)
distance = huge(i)

read*,N,Q

do j=1,N
  Read*,S,T,X
  do i=1,T-S
    distance(S-X +i-1)=min(X,distance(S-X +i-1))
  end do
end do

do i=1,10
  if(distance(i)==huge(distance))distance(i)=-1
end do

do i=1,Q
  read*,Q
  print"(i0)",distance(Q)
end do
end
  