n, q = gets.split.map(&:to_i)

constructions = n.times.map { gets.split.map(&:to_i) }
start_times = q.times.map { gets.to_i }
events = constructions.flat_map { |s, t, x|
  [[s - x, :push, x],
   [t - x, :delete, x]]
}.sort
set = []

i = 0
events.each do |t, meth, x|
  unless t <= start_times[i]
    puts set.min || -1
    i += 1
    unless i < start_times.size
      break
    end
  end
  set.send(meth, x)
end

while i < start_times.size
  puts set.min || -1
  i += 1
end
