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

stx = []
n.times do
  s,t,x = gets.split(" ").map(&:to_i)
  s -= x
  t -= x
  stx << [s,t,x]
end

di = []
q.times do |i|
  d = gets.to_i
  di << [d, i]
end

stx = stx.sort_by{|s,t,x| x}
ans = [-1]*(q)

stx.each_with_index do |(s,t,x),i|
  lb = di.bsearch_index{|d,_| d >= s}
  next if lb.nil?
  ub = di.bsearch_index{|d,_| d >= t}
  ub = q if ub.nil?
  lb.upto(ub-1) do |j|
    tmp = ans[di[j][1]]
    ans[di[j][1]] = x if tmp == -1
  end
end

puts ans
