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
start_times.each do |d|

  while i < events.size
    t, meth, x = events[i]

    if t <= d
      set.send(meth, x)
    else
      break
    end
    i += 1
  end

  puts set.min || -1
end
