class ConstructionTime
  attr_accessor :time, :position, :start_flag

  def initialize(time, position, start_flag)
    @time = time - position
    @position = position
    @start_flag = start_flag
  end

  def start?
    @start_flag
  end
end

class Walker
  attr_accessor :time, :id

  def initialize(time, id)
    @time = time
    @id = id
  end
end

def push_and_sort(array, element)
  index = array.bsearch_index { |x| x >= element }
  index = 0 if index.nil?
  array.insert(index, element)
end

N, Q = gets.chop.split.map(&:to_i)
times = []
N.times do
  s, t, x = gets.chop.split.map(&:to_i)
  times.push(ConstructionTime.new(s, x, true))
  times.push(ConstructionTime.new(t, x, false))
end
Q.times do |i|
  d = gets.chop.to_i
  times.push(Walker.new(d, i))
end

ans = [-999] * Q
consts = []
times = times.sort_by(&:time) 
times.each do |t|
  if t.is_a?(Walker)
    if consts.empty?
      ans[t.id] = -1
    else
      ans[t.id] = consts[0]
    end
    next
  end
  if t.start?
    consts = push_and_sort(consts, t.position)
  else
    consts.delete(t.position)
  end
end

ans.each do |a|
  puts a
end
