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

es = (STXs.flat_map{|s, t, x| [[s - x - 0.5, 1, x], [t - x - 0.5, -1, x]]} + Ds.map{|d| [d, 0, nil]}).sort_by(&:first)
s = []
es.each do |t, e, x|
  case e
  when 1
    s.insert(s.bsearch_index{|_| _ >= x} || -1, x)
  when -1
    s.delete_at(s.bsearch_index{|_| _ >= x})
  else
    puts s.first || -1
  end
end