require 'set'

nn, qq = gets.split.map(&:to_i)
events = []
temp = []
1.step(nn, 1) do |_i|
  temp = gets.split.map(&:to_i)
  events.push([temp[0] - temp[2], 0, temp[2]])
  events.push([temp[1] - temp[2], 1, temp[2]])
end
1.step(qq, 1) do |i|
  events.push([gets.to_i, 2, i])
end
events.sort_by!(&:first)
ss = Set.new()
ans = []
events.each do |event|
  case event[1]
  when 0
    ss.add event[2]
  when 1
    ss.delete event[2]
  else
    ss.size.zero? ? (ans[event[2]] = - 1) : (ans[event[2]] = ss.min)
  end
end

puts ans[1..-1]