n,q=gets.split.map(&:to_i)
s=n.times.map{gets.split.map(&:to_i)}
s.map!{|m| [m[0]-m[2],m[1]-m[2],m[2]]}
d=q.times.map{gets.to_i}
a=[]
s.each do |e|
    a<<[e[0], 0, e[2]]
    a<<[e[1], 1, e[2]]
end
d.each do |e|
    a<<[e, 2, 0]
end
a.sort!
x=[]
a.each do |e|
    if e[1]==0
        x << e[2]
    elsif e[1]==1
        x.delete(e[2])
    else
        p x.min || -1
    end
end