class MaxHeap
  def initialize
    @array = []
  end

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

    # sifting up
    index = @array.size - 1
    until index == 0
      pindex = (index - 1) / 2
      if @array[index] <=> @array[pindex] <= 0
        break
      else
        @array[pindex], @array[index] = @array[index], @array[pindex]
        index = pindex
      end
    end
  end

  alias push insert

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

    @array[0]
  end

  def size
    @array.size
  end

  def empty?
    @array.empty?
  end

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

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

    @array[0] = last
    i = 0
    # sifting down
    while i*2+1 < @array.size
      if i*2+2 < @array.size &&
         @array[i*2+1] <=> @array[i*2+2] <= 0
        if @array[i*2+2] <=> @array[i] <= 0
          break
        else
          @array[i], @array[i*2+2] = @array[i*2+2], @array[i]
          i = i*2+2
        end
      else
        if @array[i*2+1] <=> @array[i] <= 0
          break
        else
          @array[i], @array[i*2+1] = @array[i*2+1], @array[i]
          i = i*2+1
        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 = MaxHeap.new
ts = {}
ans = []

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

  while !heap.empty? && ts[heap.peek] <= d
    heap.pop
  end

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

puts ans
