N,Q = gets.split.map(&:to_i)
STX = N.times.map{
	s,t,x = gets.split.map(&:to_i)
	next s-x,t-x,x
}.sort_by!{|s,| s }
D = Q.times.map{ gets.to_i }

min = []

puts D.map{|d|
	while ! STX.empty? && STX[0][0] <= d
		_,t,x  = STX.shift
		i = min.bsearch_index{|_,xm| x<xm }||min.size
		j = min.bsearch_index{|tm,| t<tm }||min.size
		min[i...j] = i<=j ? [[t,x]] : []
	end
	min.shift(min.index{|tm,| d<tm }||min.size)
	next min.empty? ? -1 : min[0][1]
}
