#5814544

from bisect import bisect_left

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

STX = []
D = []
for _ in range(N):
    STX.append(list(map(int,input().split())))
for _ in range(Q):
    D.append(int(input()))

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

ans = [-1]*Q
skip = [-1]*Q

for s,t,x in STX:
    left = bisect_left(D,s-x)
    right = bisect_left(D,t-x)

    while left < right:
        if skip[left] == -1:
            ans[left] = x
            skip[left] = right
            left += 1
        else:
            left = skip[left]
    
for a in ans:
    print(a) from bisect import bisect_left N,Q = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split Q STX = [] STX [] D = [] D [] for _ in range(N):
    STX.append(list(map(int,input().split()))) _ range(N) range N STX.append(list(map(int,input().split()))) STX.append STX append list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split for _ in range(Q):
    D.append(int(input())) _ range(Q) range Q D.append(int(input())) D.append D append int(input()) int input() input STX.sort(key=lambda x:x[2]) STX.sort STX sort key=lambda x:x[2] key lambda x:x[2] x[2] x 2 x ans = [-1]*Q ans [-1]*Q [-1] -1 Q skip = [-1]*Q skip [-1]*Q [-1] -1 Q for s,t,x in STX:
    left = bisect_left(D,s-x)
    right = bisect_left(D,t-x)

    while left < right:
        if skip[left] == -1:
            ans[left] = x
            skip[left] = right
            left += 1
        else:
            left = skip[left]
     s t x STX left = bisect_left(D,s-x) left bisect_left(D,s-x) bisect_left D s-x s x right = bisect_left(D,t-x) right bisect_left(D,t-x) bisect_left D t-x t x while left < right:
        if skip[left] == -1:
            ans[left] = x
            skip[left] = right
            left += 1
        else:
            left = skip[left]
     left < right left right if skip[left] == -1:
            ans[left] = x
            skip[left] = right
            left += 1
        else:
            left = skip[left]
     skip[left] == -1 skip[left] skip left -1 ans[left] = x ans[left] ans left x skip[left] = right skip[left] skip left right left += 1 left 1 left = skip[left] left skip[left] skip left for a in ans:
    print(a) a ans print(a) print a Q = map(int,input().split()) map(int,input().split()) Q STX = [] [] STX right = bisect_left(D,t-x) bisect_left(D,t-x) right left = bisect_left(D,s-x) bisect_left(D,s-x) left D = [] [] D left = skip[left] skip[left] left skip = [-1]*Q [-1]*Q skip N,Q = map(int,input().split()) map(int,input().split()) N ans = [-1]*Q [-1]*Q ans left += 1 1 left
#5814544

from bisect import bisect_left

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

STX = []
D = []
for _ in range(N):
    STX.append(list(map(int,input().split())))
for _ in range(Q):
    D.append(int(input()))

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

ans = [-1]*Q
skip = [-1]*Q

for s,t,x in STX:
    left = bisect_left(D,s-x)
    right = bisect_left(D,t-x)

    while left < right:
        if skip[left] == -1:
            ans[left] = x
            skip[left] = right
            left += 1
        else:
            left = skip[left]
    
for a in ans:
    print(a)