class ConstructionTime
  attr_accessor :time, :position, :start_flag

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

  def start?
    @start_flag
  end

  def to_s
    "Const #{@time} #{@position} #{start_flag}"
  end
end

class Walker
  attr_accessor :time, :id

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

  def to_s
    "walker#{@id} #{@time} "
  end
end

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

def delete(array, element)
  index = array.bsearch_index { |x| x >= element }
  array.delete_at(index)
  array
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 = []
consts = []
times = times.sort_by(&:time)
times.each do |t|
  if t.is_a?(Walker)
    ans << if consts.empty?
             -1
           else
             consts[0]
           end
    next
  end
  consts = if t.start?
             push_and_sort(consts, t.position)
           else
             delete(consts, t.position)
           end
end

ans.each do |a|
  puts a
end
