from bisect import bisect_left

N,Q = (int(x) for x in input().split())

stop_arr = [tuple(map(int, input().split())) for _ in range(N)]
Q_arr = [int(input()) for _ in range(Q)]

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

ans_arr = [-1]*Q
skip_arr = [-1]*(Q+1)

for s,t,x in stop_arr:
    q_start = bisect_left(Q_arr, s-x)
    q_stop = bisect_left(Q_arr, t-x)
    l = q_start
    while l < q_stop:
        if skip_arr[l] == -1:
            skip_arr[l] = q_stop
            ans_arr[l] = x
            l += 1
        else:
            l = skip_arr[l]

print(*ans_arr, sep="\n") from bisect import bisect_left int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x N,Q = (int(x) for x in input().split()) N (int(x) for x in input().split()) Q tuple(map(int, input().split())) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) tuple(map(int, input().split())) tuple map(int, input().split()) map int input().split() ().split () input split stop_arr = [tuple(map(int, input().split())) for _ in range(N)] stop_arr [tuple(map(int, input().split())) for _ in range(N)] int(input()) for _ in range(Q) for _ in range(Q) _ range(Q) range Q for _ in range(Q) int(input()) int input() input Q_arr = [int(input()) for _ in range(Q)] Q_arr [int(input()) for _ in range(Q)] stop_arr.sort(key=lambda x:x[2]) stop_arr.sort stop_arr sort key=lambda x:x[2] key lambda x:x[2] x[2] x 2 x ans_arr = [-1]*Q ans_arr [-1]*Q [-1] -1 Q skip_arr = [-1]*(Q+1) skip_arr [-1]*(Q+1) [-1] -1 Q+1 Q 1 for s,t,x in stop_arr:
    q_start = bisect_left(Q_arr, s-x)
    q_stop = bisect_left(Q_arr, t-x)
    l = q_start
    while l < q_stop:
        if skip_arr[l] == -1:
            skip_arr[l] = q_stop
            ans_arr[l] = x
            l += 1
        else:
            l = skip_arr[l] s t x stop_arr q_start = bisect_left(Q_arr, s-x) q_start bisect_left(Q_arr, s-x) bisect_left Q_arr s-x s x q_stop = bisect_left(Q_arr, t-x) q_stop bisect_left(Q_arr, t-x) bisect_left Q_arr t-x t x l = q_start l q_start while l < q_stop:
        if skip_arr[l] == -1:
            skip_arr[l] = q_stop
            ans_arr[l] = x
            l += 1
        else:
            l = skip_arr[l] l < q_stop l q_stop if skip_arr[l] == -1:
            skip_arr[l] = q_stop
            ans_arr[l] = x
            l += 1
        else:
            l = skip_arr[l] skip_arr[l] == -1 skip_arr[l] skip_arr l -1 skip_arr[l] = q_stop skip_arr[l] skip_arr l q_stop ans_arr[l] = x ans_arr[l] ans_arr l x l += 1 l 1 l = skip_arr[l] l skip_arr[l] skip_arr l print(*ans_arr, sep="\n") print *ans_arr ans_arr sep="\n" sep "\n" q_stop = bisect_left(Q_arr, t-x) bisect_left(Q_arr, t-x) q_stop stop_arr = [tuple(map(int, input().split())) for _ in range(N)] [tuple(map(int, input().split())) for _ in range(N)] stop_arr q_start = bisect_left(Q_arr, s-x) bisect_left(Q_arr, s-x) q_start Q_arr = [int(input()) for _ in range(Q)] [int(input()) for _ in range(Q)] Q_arr skip_arr = [-1]*(Q+1) [-1]*(Q+1) skip_arr l = q_start q_start l ans_arr = [-1]*Q [-1]*Q ans_arr l = skip_arr[l] skip_arr[l] l Q = (int(x) for x in input().split()) (int(x) for x in input().split()) Q N,Q = (int(x) for x in input().split()) (int(x) for x in input().split()) N l += 1 1 l
from bisect import bisect_left

N,Q = (int(x) for x in input().split())

stop_arr = [tuple(map(int, input().split())) for _ in range(N)]
Q_arr = [int(input()) for _ in range(Q)]

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

ans_arr = [-1]*Q
skip_arr = [-1]*(Q+1)

for s,t,x in stop_arr:
    q_start = bisect_left(Q_arr, s-x)
    q_stop = bisect_left(Q_arr, t-x)
    l = q_start
    while l < q_stop:
        if skip_arr[l] == -1:
            skip_arr[l] = q_stop
            ans_arr[l] = x
            l += 1
        else:
            l = skip_arr[l]

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