parseInt(x)=parse(Int,x)
parseMap(x::Array{SubString{String},1})=map(parseInt,x)
function bsearchg(a,x)
	l,r = 1,length(a[1,:])
	while l <= r
		m = r-div(r-l,2)
		if a[1,m] <= x < a[2,m]
			r = m-1
		else
			l = m+1
		end
	end
	return(l-1)
end

function main()
	n,q = readline() |> split |> parseMap
	a = Array{Int}(3,n)
	for i in 1:n
		s,t,x = readline() |> split |> parseMap
		a[1,i] = x-s
		a[2,i] = x-t
		a[3,i] = x
	end
	a = sortcols(a,by=x->x[1])
	for i in 1:q
		d = readline() |> parseInt
		x = bsearchg(a,d)
		println(1<=x<=n?x:-1)
	end
end

main()
