#!/usr/bin/env python3

import sys, math, itertools, collections, bisect, heapq

input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')

inf = float('inf') ;mod = 10**9+7

mans = inf ;ans = 0 ;count = 0 ;pro = 1



n,q=map(int,input().split())

STX=[tuple(map(int,input().split())) for i in range(n)]

D=[int(input()) for i in range(q)]

event=[]

for si,ti,xi in STX:

  event.append((si-xi,0,xi))

  event.append((ti-xi,-1,xi))

for di in D:

  event.append((di,1,di))

event.sort()

hq=[]; S=set()

ans = []

for time, query, number in event:

  if query == 0:

    heapq.heappush(hq,number)

    S.add(number)

  elif query == -1:

    S.remove(number)

  else:

    while hq and hq[0] not in S:

      heapq.heappop(hq)

    if not hq:

      ans.append(-1)

    else:

      ans.append(hq[0])

print(*ans,sep="\n")





#!/usr/bin/env python3

import sys, math, itertools, collections, bisect, heapq

input = lambda: sys.stdin.buffer.readline()

inf = float('inf') ;mod = 10**9+7

mans = inf ;ans = 0 ;count = 0 ;pro = 1



n,q=map(int,input().split())

STX=[tuple(map(int,input().split())) for i in range(n)]

D=[int(input()) for i in range(q)]

event=[]

for si,ti,xi in STX:

  event.append((si-xi,0,xi))

  event.append((ti-xi,-1,xi))

for di in D:

  event.append((di,1,di))

event.sort()

hq=[]; S=set()

ans = []

for time, query, number in event:

  if query == 0:

    heapq.heappush(hq,number)

    S.add(number)

  elif query == -1:

    S.remove(number)

  else:

    while hq and hq[0] not in S:

      heapq.heappop(hq)

    if not hq:

      ans.append(-1)

    else:

      ans.append(hq[0])

print(*ans,sep="\n")





#!/usr/bin/env python3
import sys, math, itertools, collections, bisect, heapq

input = lambda: sys.stdin.buffer.readline().rstrip().decode("utf-8")
inf = float("inf")
mod = 10**9 + 7
mans = inf
ans = 0
count = 0
pro = 1
n, q = map(int, input().split())
STX = [tuple(map(int, input().split())) for i in range(n)]
D = [int(input()) for i in range(q)]
event = []
for si, ti, xi in STX:
    event.append((si - xi, 0, xi))
    event.append((ti - xi, -1, xi))
for di in D:
    event.append((di, 1, di))
event.sort()
hq = []
S = set()
ans = []
for time, query, number in event:
    if query == 0:
        heapq.heappush(hq, number)
        S.add(number)
    elif query == -1:
        S.remove(number)
    else:
        while hq and hq[0] not in S:
            heapq.heappop(hq)
        if not hq:
            ans.append(-1)
        else:
            ans.append(hq[0])
print(*ans, sep="\n")

#!/usr/bin/env python3
import sys, math, itertools, collections, bisect, heapq

input = lambda: sys.stdin.buffer.readline()
inf = float("inf")
mod = 10**9 + 7
mans = inf
ans = 0
count = 0
pro = 1
n, q = map(int, input().split())
STX = [tuple(map(int, input().split())) for i in range(n)]
D = [int(input()) for i in range(q)]
event = []
for si, ti, xi in STX:
    event.append((si - xi, 0, xi))
    event.append((ti - xi, -1, xi))
for di in D:
    event.append((di, 1, di))
event.sort()
hq = []
S = set()
ans = []
for time, query, number in event:
    if query == 0:
        heapq.heappush(hq, number)
        S.add(number)
    elif query == -1:
        S.remove(number)
    else:
        while hq and hq[0] not in S:
            heapq.heappop(hq)
        if not hq:
            ans.append(-1)
        else:
            ans.append(hq[0])
print(*ans, sep="\n")

-input = lambda: sys.stdin.buffer.readline().rstrip().decode("utf-8") +input = lambda: sys.stdin.buffer.readline()