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

  idx = dd.bsearch_index{|x| x > ng_start-1}
  next if idx.nil?

  while dd[idx] <= ng_end do
    ans[idx] = x if ans[idx] == -1
    idx += 1
  end
end

puts ans.join("\n")