class Heap
    attr_reader :size
    def initialize
        @heap = []
        @size = 0
    end

    def length
        @size
    end

    def push(x)
        i = @size
        @size += 1
        while i > 0
            p = (i-1)/2
            break if @heap[p] <= x
            @heap[i] = @heap[p]
            i = p
        end
        @heap[i] = x
    end

    def pop
        return nil if @size == 0
        ret = @heap[0]
        @size -= 1
        x = @heap[@size]
        i = 0
        while i*2+1 < @size
            a = i*2+1
            b = a+1
            if b < @size && @heap[b] < @heap[a]
                a = b
            end
            break if @heap[a] >= x
            @heap[i] = @heap[a]
            i = a
        end
        @heap[i] = x
        @heap.pop
        return ret
    end

    def top
        @heap[0]
    end
end

INF = 1<<30
INF2 = 1<<60
mask = INF-1
mask2 = INF2-1

N, Q = gets.split.map(&:to_i)
events = []
N.times do |i|
    s, t, x = gets.split.map(&:to_i)
    next if t-x <= 0
    events.push(((s-x)<<60) + (x<<30) + t-x)
end
events.sort!
events.push(1<<90)

exit

pt = 0
heap = Heap.new
heap.push((1<<60) + mask)
Q.times do
    d = gets.to_i
    while (events[pt]>>60) <= d
        heap.push(events[pt] & mask2)
        pt += 1
    end
    heap.pop while (heap.top & mask) <= d
    ans = heap.top >> 30
    puts (ans == INF ? -1 : ans)
end
