def bisect_left(arr, target)
  left = 0
  right = arr.size - 1
  while left <= right
    middle = (left + right)/2
    if arr[middle] < target
      left = middle + 1
    elsif arr[middle] > target
      right = middle - 1
    else
      while middle > 0 && arr[middle - 1] == target
        middle -= 1
      end
      return middle
    end
  end
  return left
end

n, q = gets.split.map(&:to_i)
stx = n.times.map { gets.split.map(&:to_i) }
ds = q.times.map { gets.to_i }
stx.map! { |s,t,x| [s-x, t-x, x] }.sort_by!(&:last).reverse!
ans = Array.new(q, -1)

stx.each do |s, t, x|
  l = bisect_left(ds, s)
  r = bisect_left(ds, t)
  ans.fill(x, l, r - l)
end

puts ans
