#二分ヒープ
class BinaryHeap
  def initialize(n, &b)
    @heap = Array.new(n)
    @size = 0
    #ex) |parent, child| parent <= child
    #@b = b
  end
  def push(x)
    me = @size
    @size += 1
    while 0 < me do
      parent = (me - 1) >> 1
      #break if @b.call(@heap[parent], x)
      break if @heap[parent] <= x
        @heap[me] = @heap[parent]
        me = parent
    end
    @heap[me] = x
  end
  def shift
    wk = @heap[0]
    me = 0
    @size -= 1
    x = @heap[@size]
    while me < @size do
      child = (me << 1) + 1
      break if child >= @size
      #if (child + 1) < @size && @b.call(@heap[child + 1], @heap[child]) then
      if (child + 1) < @size && @heap[child + 1] <= @heap[child] then
        child += 1
      end
      #break if @b.call(x, @heap[child])
      break if x <= @heap[child]
      @heap[me] = @heap[child]
      me = child
    end
    @heap[me] = x
    wk
  end
  def first
    @size == 0 ? nil : @heap[0]
  end
  def empty?
    @size == 0
  end
end

N, Q = gets.chomp.split(" ").map(&:to_i)
T = []
N.times{|i|
  s, t, x = gets.chomp.split(" ").map(&:to_i)
  next if t - x < 0
  T << ((s - x) << 64) + (x << 32) + (t - x)
}
D = []
Q.times{ D << gets.to_i}

T.sort!
z = BinaryHeap.new(N)#{|parent, child| parent[0] <= child[0]}
msk = (1 << 32) - 1
msk2 = (1 << 64) - 1
D.each{|d|
  z.shift while (not z.empty?) && (z.first & msk) <= d
  while (not T.empty?) && ((T.first >> 64) <= d) do
    tmp = T.shift
    z.push(tmp & msk2) if (tmp & msk) > d
  end
  puts z.empty? ? -1 : (z.first >> 32)
}
