n,q=gets.split.map(&:to_i)
s=n.times.map{gets.split.map(&:to_i)}
d=q.times.map{gets.to_i}
a=[]
a += s.flat_map { |e| [ [e[0]-e[2]-1, 0, e[2]] , [e[1]-e[2]-1, 1, e[2]] ] }
a.sort_by!{|sb| sb[0]}
x=[]
r=[]
rr = 0

while a[0][0] < d[0]
    as = a.shift
    if as[1]==0      
        x << as[2]
    else
        x.delete(as[2])
    end
end
a.each do |e|
    break if e[0] > d[-1]
    rp = x.min || -1
    while d[rr] <= e[0]
        r[rr] = rp
        rr += 1
        break if rr ==  q
    end

    if e[1]==0      
        x << e[2]
    else
        x.delete(e[2])
    end
end
puts r + [-1]*(q-r.size)