class SegTree
  attr_reader :original_size, :internal_size, :op

  def initialize(original_size, unit, &op)
    @original_size = original_size
    @op = op
    h = 0
    while (1 << h) < original_size
      h += 1
    end
    @internal_size = (1 << h)
    @height = h
    @array = Array.new((1 << (h+1)) - 1, unit)
  end

  def update(i, val)
    os = 0
    bs = @internal_size
    @array[i] = val
    @height.times do
      j = (os + i) | 1
      val = @op.call(@array[j ^ 1], @array[j])
      i >>= 1
      os |= bs
      bs >>= 1
      @array[os+i] = val
    end
    @array[-1]
  end

  def find(a,b)
    lv = nil; rv = nil
    os = 0
    bs = @internal_size
    while a < b
      if (a&1) == 1
        lv = lv ? @op.call(lv, @array[a]) : @array[a]
        a += 1
      end

      if (b&1) == 0
        rv = rv ? @op.call(@array[b], rv) : @array[b]
        b += -1
      end

      a = ((a-os) >> 1) | os | bs
      b = ((b-os) >> 1) | os | bs
      os |= bs
      bs >>= 1
    end

    if a == b
      lv = lv ? @op.call(lv, @array[a]) : @array[a]
    end
    rv ? @op.call(lv, rv) : lv
  end

  def data
    @array[0...@original_size]
  end

  def fulldata
    @array
  end
end

N,Q = gets.split.map &:to_i
blocks = []
xs = {}
N.times {
  s,t,x = gets.split.map &:to_i
  blocks << [s-x-0.1, x, 1]
  blocks << [t-x-0.2, x, 2]
  xs[x] = 1
}
blocks.sort!
XMax = 10**10
xn = Hash[xs.keys.sort.map.with_index{ |x,i| [x,i] }]
st = SegTree.new(xn.size, XMax) { |a,b| a < b ? a : b }
i = 0
(0...Q).each{
  x = gets.to_i
  while i < blocks.size do
    t,y,q = blocks[i]
    break if x < t
    i += 1
    n = xn[y]
#    p [x,t,y,q,n]
    if q == 1
      st.update(n, y)
    else
      st.update(n, XMax)
    end
  end
  v = st.find(0,xn.size-1)
  puts v == XMax ? -1 : v
}