n, q = gets.chomp.split(' ').map(&:to_i)

arr = []
n.times do |i|
  s, t, x = gets.chomp.split(' ').map(&:to_i)
  arr[i] = [s, t, x]
end
arr = arr.sort_by { |s, t, x| x }

answer = []
q.times do
  stop = false
  d = gets.chomp.to_i
  arr.each do |s, t, x|
    if s <= d + x && d + x < t
      answer.push x
      stop = true
      break
    end
  end
  answer.push -1 unless stop
end

puts answer
