#二分ヒープ
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)
        @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
        child += 1
      end
      break if @b.call(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, t - x, x]
}

T.sort!{|a, b| a[0] <=> b[0]}
a = Hash.new
z = BinaryHeap.new(N){|parent, child| parent[0] <= child[0]}

Q.times{
  d = gets.to_i
  while (not z.empty?) && (z.first[1]) <= d do
    z.shift
  end
  if T.size != 0 && T.first[0] <= d then
    while (not T.empty?) && T.first[0] <= d do
      s, t, x = T.shift
      next if t <= d
      z.push([x, t])
    end
  end
  puts z.empty? ? -1 : z.first[0]
}
