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

ds, s = Ds.sort, []
i, j = 0, 0
STXs.flat_map{|s, t, x| [[s - x, x, 1], [t - x, x, -1]]}.sort_by(&:first).each do |t, x, e|
  j = ds.bsearch_index{|d| d >= t}
  break unless j
  m = s.first || -1
  (j - i).times{puts m}
  i = j
  if e == 1
    s.insert(s.bsearch_index{|_| _ >= x} || -1, x)
  else
    s.delete_at(s.bsearch_index{|_| _ >= x})
  end
end
m = s.first || -1
ds[i .. -1].each{puts m}