GC.disable
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

    i = 0
    # sifting down
    while true
      child = i*2+1
      unless child < @arr.size # we've hit the bottom
        break
      end

      if child + 1 < @arr.size && @arr[child + 1] < @arr[child]
        child += 1
      end

      if @arr[child] >= last
        break
      else
        @arr[i] = @arr[child]
        i = child
      end

    end
    @arr[i] = last

    return top
  end
end

n, q = gets.split.map(&:to_i)
sxt = []
n.times do
  s, t, x = gets.split.map(&:to_i)
  unless t - x <= 0
    sxt.push( ((s-x) << 60) | (x << 30) | (t-x) )
  end
end
sxt.sort!
ds = q.times.map { gets.to_i }

heap = MinHeap.new
ans = []

i = 0
ds.each do |d|
  while !heap.empty? && (heap.peek & ((1<<30) - 1)) <= d
    heap.pop
  end

  while i < sxt.size && ((tmp = sxt[i]) >> 60) <= d
    unless (tmp & ((1<<30) - 1)) <= d
      heap.push(tmp & ((1<<60) - 1))
    end
    i += 1
  end

  if heap.empty?
    ans << -1
  else
    ans << (heap.peek >> 30)
  end
end

puts ans
