N, Q = gets.split.map(&:to_i)
STXs = N.times.map{gets.split.map(&:to_i)}
Ds = Q.times.map{gets.to_i}

require 'set'

ds, s = Ds.dup, Set.new
STXs.flat_map{|s, t, x| [[s - x, true, x], [t - x, false, x]]}.sort_by(&:first).each do |t, e, x|
  u = s.min || -1
  ds.shift(ds.bsearch_index{|d| d >= t} || 0).each{puts u}
  e ? s.add(x) : s.delete(x)
end
ds.each{puts -1}