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
}
D = Q.times.map{ gets.to_i }

min,xts = [],STX.map{|s,t,x|
	next x,
		D.bsearch_index{|d| t<=d }||Q,
		D.bsearch_index{|d| s<=d }||Q
}.sort_by{|_,_,s| s }

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