class BIT
    def initialize(n)
        @n = n
        @dat = Array.new(@n, 0)
    end

    def sum(i)
        s = 0
        while i >= 0 do
            s += @dat[i]
            i = (i & (i+1)) - 1
        end
        s
    end

    def add(i, x)
        while i < @n do
            @dat[i] += x
            i |= i+1
        end
    end

    def lower_bound(x)
        ret = -1
        k = 1
        k <<= 1 while 2*k <= @n
        while k > 0
            if ret+k < @n && @dat[ret+k] < x
                x -= @dat[ret+k]
                ret += k
            end
            k >>= 1
        end
        ret + 1
    end
end

N, Q = gets.split.map(&:to_i)
events = {}
xs = {}
N.times do |i|
    s, t, x = gets.split.map(&:to_i)
    if events[s-x]
        events[s-x].push(x)
    else
        events[s-x] = [x]
    end
    if events[t-x]
        events[t-x].push(-x)
    else
        events[t-x] = [-x]
    end
    xs[x] = true
end
ts = events.keys.sort
ts.push(10**18)
xs = xs.keys.sort
compress = {}
sz = xs.size
sz.times do |i|
    compress[xs[i]] = i
end
xs[sz] = -1
bit = BIT.new(sz)

pt = 0
Q.times do
    d = gets.to_i
    while ts[pt] <= d
        events[ts[pt]].each do |x|
            bit.add(compress[x.abs], x > 0 ? 1 : -1)
        end
        pt += 1
    end
    puts xs[bit.lower_bound(1)]
end
