n,q=gets.split.map(&:to_i)
s=n.times.map{gets.split.map(&:to_i)}
d=q.times.map{gets.to_i}
s.map!{|m| [m[0]-m[2],m[1]-m[2]-1,m[2]]}
ll = d.map do |m|
    l = s.select {|ss| ss[0] <= m && ss[1] >= m}.map{|sm| sm[2]}
    l.min || -1
end
puts ll
