class Node
  attr_accessor :value, :left, :right

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

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

  def each
    @left&.each { |elt| yield(elt) }
    yield(@value)
    @right&.each { |elt| yield(elt) }
    self
  end

end

class Set
  attr_accessor :tree

  def initialize
    @tree = nil
  end

  def min
    @tree&.min_value
  end

  def insert(elt)
    node = @tree
    parent = self
    setter = :"tree="

    while true
      if node.nil?
        parent.send(setter, Node.new(elt))
        break
      end

      d = elt <=> node.value
      if d < 0
        parent = node
        setter = :"left="
        node = node.left
      elsif d > 0
        parent = node
        setter = :"right="
        node = node.right
      else
        break
      end
    end
  end

  def remove(elt)
    _remove(self, :"tree=", @tree, elt)
  end

  def _remove(parent, setter, node, elt)
    while node
      d = elt <=> node.value
      if d < 0
        parent = node
        setter = :"left="
        node = node.left
      elsif d > 0
        parent = node
        setter = :"right="
        node = node.right
      else
        if node.left.nil?
          if node.right.nil?
            #p :a
            parent.send(setter, nil)
          else
            #p :b
            parent.send(setter, node.right)
          end
        else
          if node.right.nil?
            #p :c
            parent.send(setter, node.left)
          else
            #p :d
            # find left most node
            parent2 = node
            setter2 = :"right="
            node2 = node.right
            while node2.left
              parent2 = node2
              setter2 = :"left="
              node2 = node2.left
            end

            node.value = node2.value
            _remove(parent2, setter2, node2, node2.value)
          end
        end
        break
      end
    end
  end

  def each
    @tree&.each do |elt|
      yield(elt)
    end
    self
  end

  def to_a
    res = []
    each do |elt|
      res << elt
    end
    res
  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

min_cache = nil
cache_stale = true
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
      cache_stale = true
    else
      break
    end
    i += 1
  end

  if cache_stale
    min_cache = set.min || -1
    cache_state = false
  end
  puts min_cache
end
