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

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