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

constructions = n.times.map { gets.split.map(&:to_i) }
constructions.map! { |s, t, x|
  [s-x, t-x, x]
}.sort_by!(&:last)

start_times = q.times.map { gets.to_i }

start_times.each do |d|
  ans = -1
  constructions.each do |s, t, x|
    if d.between?(s, t-1)
      ans = x
      break
    end
  end
  puts ans
end
