class Heap
  def initialize
    @a = [nil]
    @h = {}
  end

  def swap(i, j)
    @a[i], @a[j] = @a[j], @a[i]
    @h[@a[i]], @h[@a[j]] = i, j
  end

  def up(i)
    p = i / 2
    return if i <= 1 || @a[p] <= @a[i]
    swap(i, p)
    up(p)
  end

  def down(i)
    c = i * 2
    a = @a.size
    return if c >= a
    c += 1 if c != a - 1 && @a[c] > @a[c + 1]
    return if @a[i] <= @a[c]
    swap(i, c)
    down(c)
  end

  def add(v)
    return if @h[v]
    @a << v
    i = @a.size - 1
    @h[v] = i
    up(i)
  end

  def delete(v)
    return unless i = @h[v]
    u = @a[-1]
    swap(i, -1)
    ret = @a.pop
    @h[ret] = nil
    v > u ? up(i) : down(i)
    ret
  end

  def first
    @a[1] || -1
  end
end

class Event
  TYPE_START = 0
  TYPE_END = 1
  TYPE_HUMAN = 2

  attr_reader :time, :type, :point

  def initialize(time, type, point)
    @time = time
    @type = type
    @point = point
  end

  def start?
    @type == TYPE_START
  end

  def end?
    @type == TYPE_END
  end

  def human?
    @type == TYPE_HUMAN
  end

  class << self
    def start(time, point)
      new(time, TYPE_START, point)
    end

    def end(time, point)
      new(time, TYPE_END, point)
    end

    def human(time)
      new(time, TYPE_HUMAN, 0)
    end
  end
end


def road_work(works, people)
  events = []

  works.each do |s, t, x|
    events << Event.start(s - x, x)
    events << Event.end(t - x, x)
  end

  people.each { |p| events << Event.human(p) }

  heap = Heap.new
  ans = []
  events.sort_by! { |e| e.time }.each do |event|
    heap.add(event.point) if event.start?
    heap.delete(event.point) if event.end?
    ans << heap.first if event.human?
  end

  ans
end

n, q = gets.split.map(&:to_i)
works = []
n.times { works << gets.split.map(&:to_i) }
people = []
q.times { people << gets.chomp.to_i }

puts road_work(works, people)
