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

stx = []
n.times do |i|
  stx[i] = gets.split(" ").map(&:to_i)
  stx[i][0] -= stx[i][2]
  stx[i][1] -= stx[i][2]
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)

p stx
n.times do |i|
  s = stx[i][0]
  t = stx[i][1]
  x = stx[i][2]
  lb = di.bsearch_index{|d,i| d >= s}
  p lb
  while !lb.nil? && lb < di.length && di[lb][0] <  t
    ans[di[lb][1]] = x
    di.delete_at(lb)
  end
end

puts ans
