N, Q = map(int, input().split())

list_a = []
list_b = []
list_dist = []

for i in range(N):
  list_a.append(list(map(int, input().split())))

for j in range(Q):
  list_b.append(int(input()))

list_a.sort(key=lambda x:x[2])


for b in list_b:
  dist = 0
  time = b
  stop_flag = 0
  for a in list_a:
    time = time + a[2] - dist
    dist = a[2]
    if time > a[0]-0.5 and time < a[1]-0.5:
      stop_flag = 1
      break
  if stop_flag == 0:
    list_dist.append(-1)
  else:
    list_dist.append(dist)

for dist in list_dist:
  print(dist)