class PQ
	def initialize
		@h = [] # min-heap
	end

	def top
		@h[0]
	end

	def enq v
		@h << v
		up_heap
	end

	def deq
		return if @h.empty?

		@h[-1],@h[0] = @h[0],@h[-1]
		v = @h.pop
		dn_heap
		return v
	end

private
	def up_heap
		v,ic,ip = @h[-1],@h.size-1
		ic = ip while 0 < ic and v < @h[ip=(ic-1)/2]
		@h[-1],@h[ic] = @h[ic],v
	end

	def dn_heap
		v,ip,sz = @h[0],0,@h.size
		while (ic = 2*ip+1) < sz
			ic += 1 if ic+1 < sz and @h[ic+1] < @h[ic]
			break if @h[ip] < @h[ic]
			@h[ip],@h[ic],ip = @h[ic],@h[ip],ic
		end
	end
end

min = PQ.new 
del = PQ.new
fs = [
	lambda{|x|
		min.enq x
	},
	lambda{|x|
		del.enq x
	},
	lambda{
		(min.deq; del.deq) while min.top && min.top == del.top
		p(min.top||-1)
	}
]

q = []

N,Q = gets.split.map(&:to_i)
N.times{
	s,t,x = gets.split.map(&:to_i)
	q << [s-x-0.5,fs[0],x] << [t-x-0.5,fs[1],x]
}
Q.times{
	q << [gets.to_i,fs[2]]
}

q.sort_by!{|t,|t}

until q.empty?
	_,f,*x = q.shift
	f[*x]
end
