class Heap
    attr_reader :size
    def initialize(n)
        @heap = Array.new(n)
        @size = 0
    end

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

    def pop
        @size -= 1
        x = @heap[@size]
        i = 0
        a = (i<<1)+1
        while a < @size
            if a+1 < @size && @heap[a+1] < @heap[a]
                a += 1
            end
            break if @heap[a] >= x
            @heap[i] = @heap[a]
            i = a
            a = (i<<1)+1
        end
        @heap[i] = x
    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)

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