    class ConstructionTime
      attr_accessor :time, :position, :start_flag
     
      def initialize(time, position, start_flag)
        @time = time - position - 0.5
        @time += 0.1 if start_flag
        @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 = []
    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
      if t.start?
        consts = push_and_sort(consts, t.position)
      else
        consts.delete(t.position)
      end
    end
     
    ans.each do |a|
      puts a
    end