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

stoppers = N.times.map do
  gets.chomp.split(' ').map(&:to_i)
end

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

puts ( walkers.map do |walker_offset|
  stops = stoppers.map do |s|
    assume_time = s[2] + walker_offset
    s[0] <= assume_time && assume_time <= s[1] ? s[2] : -1
  end
  p stops
  stops.max == -1 ? -1 : stops.select{ |v| v != -1 }.min
end )
