class MinHeap
  def initialize
    @arr = []
  end

  def insert(key)
    @arr.push(key)

    # sifting up
    i = @arr.size - 1
    until i == 0
      par = (i - 1) / 2
      if @arr[i] >= @arr[par]
        break
      else
        @arr[par], @arr[i] = @arr[i], @arr[par]
        i = par
      end
    end
  end

  alias push insert

  def peek
    if @arr.empty?
      fail 'empty'
    end

    @arr[0]
  end

  def size
    @arr.size
  end

  def empty?
    @arr.empty?
  end

  def pop
    if @arr.empty?
      fail 'empty'
    end

    top = @arr[0]
    last = @arr.pop
    if @arr.empty?
      return top
    end

    @arr[0] = last
    i = 0
    # sifting down
    while true
      left = i*2+1
      right = left + 1
      break unless left < @arr.size # we've hit the bottom

      if right < @arr.size && @arr[left] > @arr[right]

        if @arr[right] >= @arr[i]
          break
        else
          @arr[i], @arr[right] = @arr[right], @arr[i]
          i = right
        end

      else

        if @arr[left] >= @arr[i]
          break
        else
          @arr[i], @arr[left] = @arr[left], @arr[i]
          i = left
        end

      end

    end

    return top
  end
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!

heap = MinHeap.new
ts = {}
ans = []

i = 0
ds.each do |d|
  while !heap.empty? && ts[heap.peek] <= d
    heap.pop
  end

  while i < stx.size && stx[i][0] <= d
    s, t, x = stx[i]
    unless t <= d
      heap.push(x)
      ts[x] = t
    end
    i += 1
  end

  if heap.empty?
    ans << -1
  else
    ans << heap.peek
  end
end

puts ans
