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], 0, e[2]] , [e[1]-e[2], 1, e[2]] ] } + [[1000000000,0,-1]]
a.sort_by!{|sb| sb[0]}
x=[]
r=[]
rr = 0
a.each do |e|
    break if rr ==  q
    if e[1]==0
        x << e[2]
    elsif e[1]==1
        x.delete(e[2])
    end
    rp = x.min || -1
    while d[rr] <= e[0]
        r[rr] = rp
        rr += 1
        break if rr ==  q
    end
end
puts r