from bisect import bisect_left
import sys
input = sys.stdin.readline

def main():
	N, Q = map(int, input().split())
	A = [tuple(map(int, input().split())) for i in range(N)]
	A.sort(key = lambda x: x[2])
	D = [int(input()) for i in range(Q)]
	ans = [-1] * Q
	
	donecnt = 0
	done = [False] * Q
	for a in A:
		S, T, X = a
		for j in range(bisect_left(D, S - X), bisect_left(D, T - X)):
			if not done[j]:
				ans[j] = X
				done[j] = True
				donecnt += 1
				if donecnt == Q:
					break
		if donecnt == Q:
			break
	for k in range(Q):
		print(ans[k])
		
if __name__ == "__main__":
	main()