n, q = gets.split.map(&:to_i)
stxs = n.times.map{ gets.split.map(&:to_i) }
ds   = q.times.map{ gets.to_i }

ans = Array.new(q){ Float::INFINITY }

ds.each_with_index do | d, i | # d: スタート地点に留まっていた秒数
  stxs.each do | stx |
    s, t, x = stx
    if s <= d+x and d+x < t
      ans[i] = [ans[i], x].min
    end
  end
  ans[i] = -1 if ans[i] == Float::INFINITY
end

puts ans