nn, qq = gets.split.map(&:to_i)
stx = []
nn.times{ stx << gets.split.map(&:to_i) }
dd = readlines.map{ |i| i.chomp.to_i }

ans = Array.new(qq,-1)
stx.sort_by{|a| a[2]}.each do |s,t,x|
  # 誰も止めない
  next if t-x<1

  ng_start = (s-x>0 ? s-x : 0)
  ng_end = t-x-1

  idx1 = dd.bsearch_index{|x| x > ng_start-1}
  next if idx1.nil?
  idx2 = dd.bsearch_index{|x| x > ng_end-1}
  to =
    if idx2.nil?
      qq-1
    elsif dd[idx2]==ng_end
      idx2
    else
      idx2-1
    end

  idx1.upto(to) do |index|
    ans[index] = x if ans[index] == -1
  end
end

puts ans.join("\n")
