class T
	def initialize n,v
		@l = 1<<(n-1).bit_length
		@v = v
		@h = [nil]*(@l+@l-1)
	end

	def [] i
		i += @l
		downto i
		return @h[i-1]||@v
	end

	def []= lr,v
		return if lr.size == 0
		l,r = lr.minmax.map{|l| @l+l }
		downto l
		downto r if l < r
		@h[l-1] = @h[r-1] = v
		lp,rp = l/2,r/2
		until lp == rp
			@h[2*lp] = v if l&1 < 1
			@h[2*rp-1] = v if 0 < r&1
			lp,rp,l,r = lp/2,rp/2,lp,rp
		end
	end

private
	def downto i # 1-based index of @h
		(i.bit_length-1).downto(1){|b|
			j = i>>b
			if @h[j-1]
				@h[2*j-1] = @h[2*j] = @h[j-1]
				@h[j-1] = nil
			end
		}
	end
end

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

X = T.new Q,-1
STX.each{|s,t,x|
	i = D.bsearch_index{|d| s<=d }||Q
	j = D.bsearch_index{|d| t<=d }||Q
	X[i...j] = x
}

puts (0...Q).map{|i| X[i] }
