class Node
  attr_reader :value, :left, :right

  def initialize(value, left = nil, right = nil)
    @value = value
    @left = left
    @right = right
  end

  def insert(elt)
    d = elt <=> @value

    if d < 0
      Node.new(@value,
               left ? left.insert(elt) : Node.new(elt),
               right)
    elsif d > 0
      Node.new(@value,
               left,
               right ? right.insert(elt) : Node.new(elt))
    else # d == 0
      self
    end
  end

  def min_value
    if @left.nil?
      @value
    else
      @left.min_value
    end
  end

  def remove(elt)
    d = elt <=> @value

    if d < 0
      Node.new(@value,
               @left&.remove(elt),
               @right)
    elsif d > 0
      Node.new(@value,
               @left,
               @right&.remove(elt))
    else # d == 0
      if @left.nil? && @right.nil?
        nil
      elsif @left.nil?
        @right
      elsif @right.nil?
        @left
      else # @right && @left
        min = @right.min_value
        Node.new(min,
                 @left,
                 @right.remove(min))
      end
    end
  end
end

class Set
  def initialize
    @tree = nil
  end

  def min
    @tree&.min_value
  end

  def insert(elt)
    if @tree.nil?
      @tree = Node.new(elt)
    else
      @tree = @tree.insert(elt)
    end
  end

  def remove(elt)
    unless @tree.nil?
      @tree = @tree.remove(elt)
    end
  end
end

n, q = gets.split.map(&:to_i)

constructions = n.times.map { gets.split.map(&:to_i) }
start_times = q.times.map { gets.to_i }
events = constructions.flat_map { |s, t, x|
  [[s - x, 1, x],
   [t - x, -1, x]]
}.sort
set = Set.new

i = 0
start_times.each do |d|

  while i < events.size
    t, meth, x = events[i]

    if t <= d
      case meth
      when 1
        set.insert(x)
      when -1
        set.remove(x)
      else fail
      end
    else
      break
    end
    i += 1
  end

  puts set.min || -1
end
