require 'set'

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

event = []
n.times do
  s,t,x = gets.split(" ").map(&:to_i)
  event << [s-x, 1, x] << [t-x,-1,x]
end
event = event.sort_by{|t,f,x| t}
set = SortedSet.new
now = 0 #event index
count = Hash.new{|h,k| h[k] = 0}
q.times do |i|
  d = gets.to_i
  now.upto(event.length - 1) do |j|
    e = event[j]
    t = e[0]
    f = e[1]
    x = e[2]
    if now == event.length - 1
      puts -1
      next
    elsif d < t
      #答え出力
      if set.empty?
        puts -1
      else
        puts set.first
      end
      now = j
      break
    else
      #イベント処理
      if f == 1
        set << x
        count[x] += 1
      else
        count[x] -= 1
        set.delete(x) if count[x] == 0
      end
    end
  end

end
