N, Q = gets.chomp.split(' ').map(&:to_i)

stoppers = N.times.map do
  gets.chomp.split(' ').map(&:to_i)
end.sort { |a,b| a[2] <=> b[2] }

walkers = Q.times.map do
  gets.chomp.to_i
end

puts ( walkers.map do |walker_offset|
  stops = stoppers.reduce(-1) do |dist, s|
    assume_time = s[2] + walker_offset + 1
    break s[2] if s[0] <= assume_time && assume_time <= s[1]
    dist
  end
end )
