class Treap
    attr_reader :node, :ans, :num
    class Node
        attr_accessor :val, :pri, :cnt, :sum, :lch, :rch
        def initialize(v)
            @val = v
            @pri = rand
            @cnt = 1
            @sum = v
            @lch = nil
            @rch = nil
        end
    end
 
    def initialize(v=nil)
        @node = v ? Node.new(v) : nil
        @ans = 0
        @num = 0
    end
 
    def merge(l, r)
        return l || r unless l && r
        if l.pri > r.pri
            l.rch = merge(l.rch, r)
            return l
        else
            r.lch = merge(l, r.lch)
            return r
        end
    end
 
    def split(t, v)
        return [nil, nil] unless t
        if v < t.val
            s = split(t.lch, v)
            t.lch = s[1]
            return [s[0], t]
        else
            s = split(t.rch, v)
            t.rch = s[0]
            return [t, s[1]]
        end
    end
 
    def insert(v)
        s = split(@node, v)
        n = Node.new(v)
        @node = merge(s[0], n)
        @node = merge(@node, s[1])
    end
 
    def insert_larger(v)
        n = Node.new(v)
        @node = merge(@node, n)
    end
 
    def erase(v)
        s1 = split(@node, v-1)
        s2 = split(s1[1], v)
        @node = merge(s1[0], s2[1])
    end

    def first
        return nil unless @node
        nd = @node
        nd = nd.lch while nd.lch
        nd.val
    end

    def dump_rec(t)
        return [] unless t
        return dump_rec(t.lch) + [t.val] + dump_rec(t.rch)
    end
    def dump
        return dump_rec(@node)
    end
end

N, Q = gets.split.map(&:to_i)
events_i = {}
events_o = {}
ts = {10**18 => true}
N.times do |i|
    s, t, x = gets.split.map(&:to_i)
    events_i[s-x] ||= []
    events_i[s-x].push(x)
    events_o[t-x] ||= []
    events_o[t-x].push(x)
    ts[s-x] = true
    ts[t-x] = true
end
ts = ts.keys.sort
pt = 0
treap = Treap.new

Q.times do
    d = gets.to_i
    while ts[pt] <= d
        if events_o[ts[pt]]
            events_o[ts[pt]].each do |x|
                treap.erase(x)
            end
        end
        if events_i[ts[pt]]
            events_i[ts[pt]].each do |x|
                treap.insert(x)
            end
        end
        pt += 1
    end
    puts treap.first || -1
end