import sys, heapq
input = sys.stdin.readline

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

event = []
for _ in range(N) :
    s, t, x = map(int, input().split())
    event.append([s - x, t - x, x])

D = [int(input()) for _ in range(Q)]

event.sort()

closed = []
ei = 0

for d in D :
    while ei < N and event[ei][0] <= d :
        heapq.heappush(closed, (event[ei][2], event[ei][1]))
        ei += 1
    while closed and closed[0][1] <= d :
        heapq.heappop(closed)
    
    if closed :
        print(closed[0][0])
    else :
        print(-1) import sys, heapq sys heapq input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline N, Q = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split Q event = [] event [] for _ in range(N) :
    s, t, x = map(int, input().split())
    event.append([s - x, t - x, x]) _ range(N) range N s, t, x = map(int, input().split()) s map(int, input().split()) map int input().split() ().split () input split t x event.append([s - x, t - x, x]) event.append event append [s - x, t - x, x] s - x s x t - x t x x int(input()) for _ in range(Q) for _ in range(Q) _ range(Q) range Q for _ in range(Q) int(input()) int input() input D = [int(input()) for _ in range(Q)] D [int(input()) for _ in range(Q)] event.sort() event.sort event sort closed = [] closed [] ei = 0 ei 0 for d in D :
    while ei < N and event[ei][0] <= d :
        heapq.heappush(closed, (event[ei][2], event[ei][1]))
        ei += 1
    while closed and closed[0][1] <= d :
        heapq.heappop(closed)
    
    if closed :
        print(closed[0][0])
    else :
        print(-1) d D while ei < N and event[ei][0] <= d :
        heapq.heappush(closed, (event[ei][2], event[ei][1]))
        ei += 1
     ei < N and event[ei][0] <= d ei < N ei N event[ei][0] <= d event[ei][0] [ei] event ei 0 d heapq.heappush(closed, (event[ei][2], event[ei][1])) heapq.heappush heapq heappush closed (event[ei][2], event[ei][1]) event[ei][2] [ei] event ei 2 event[ei][1] [ei] event ei 1 ei += 1 ei 1 while closed and closed[0][1] <= d :
        heapq.heappop(closed)
    
     closed and closed[0][1] <= d closed closed[0][1] <= d closed[0][1] [0] closed 0 1 d heapq.heappop(closed) heapq.heappop heapq heappop closed if closed :
        print(closed[0][0])
    else :
        print(-1) closed print(closed[0][0]) print closed[0][0] [0] closed 0 0 print(-1) print -1 closed = [] [] closed D = [int(input()) for _ in range(Q)] [int(input()) for _ in range(Q)] D ei = 0 0 ei t, x = map(int, input().split()) map(int, input().split()) t input = sys.stdin.readline sys.stdin.readline input Q = map(int, input().split()) map(int, input().split()) Q s, t, x = map(int, input().split()) map(int, input().split()) s ei += 1 1 ei N, Q = map(int, input().split()) map(int, input().split()) N event = [] [] event x = map(int, input().split()) map(int, input().split()) x
import sys, heapq
input = sys.stdin.readline

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

event = []
for _ in range(N) :
    s, t, x = map(int, input().split())
    event.append([s - x, t - x, x])

D = [int(input()) for _ in range(Q)]

event.sort()

closed = []
ei = 0

for d in D :
    while ei < N and event[ei][0] <= d :
        heapq.heappush(closed, (event[ei][2], event[ei][1]))
        ei += 1
    while closed and closed[0][1] <= d :
        heapq.heappop(closed)
    
    if closed :
        print(closed[0][0])
    else :
        print(-1)