from bisect import bisect_left

N, Q = map(int, input().split())
R = [tuple(map(int, input().split())) for i in range(N)]
R.sort(key=lambda r: r[2])
q = [int(input()) for _ in range(Q)]

ans = [-1] * Q
skip = [-1] * (Q + 1)

for s, t, x in R:
    l = bisect_left(q, s - x)
    r = bisect_left(q, t - x)
    while l < r:
        if skip[l] == -1:
            skip[l] = r
            ans[l] = x
            l += 1
        else:
            l = skip[l]
for i in range(Q):
    print(ans[i]) from bisect import bisect_left N, Q = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split Q tuple(map(int, input().split())) for i in range(N) for i in range(N) i range(N) range N for i in range(N) tuple(map(int, input().split())) tuple map(int, input().split()) map int input().split() ().split () input split R = [tuple(map(int, input().split())) for i in range(N)] R [tuple(map(int, input().split())) for i in range(N)] R.sort(key=lambda r: r[2]) R.sort R sort key=lambda r: r[2] key lambda r: r[2] r[2] r 2 r int(input()) for _ in range(Q) for _ in range(Q) _ range(Q) range Q for _ in range(Q) int(input()) int input() input q = [int(input()) for _ in range(Q)] q [int(input()) for _ in range(Q)] ans = [-1] * Q ans [-1] * Q [-1] -1 Q skip = [-1] * (Q + 1) skip [-1] * (Q + 1) [-1] -1 Q + 1 Q 1 for s, t, x in R:
    l = bisect_left(q, s - x)
    r = bisect_left(q, t - x)
    while l < r:
        if skip[l] == -1:
            skip[l] = r
            ans[l] = x
            l += 1
        else:
            l = skip[l] s t x R l = bisect_left(q, s - x) l bisect_left(q, s - x) bisect_left q s - x s x r = bisect_left(q, t - x) r bisect_left(q, t - x) bisect_left q t - x t x while l < r:
        if skip[l] == -1:
            skip[l] = r
            ans[l] = x
            l += 1
        else:
            l = skip[l] l < r l r if skip[l] == -1:
            skip[l] = r
            ans[l] = x
            l += 1
        else:
            l = skip[l] skip[l] == -1 skip[l] skip l -1 skip[l] = r skip[l] skip l r ans[l] = x ans[l] ans l x l += 1 l 1 l = skip[l] l skip[l] skip l for i in range(Q):
    print(ans[i]) i range(Q) range Q print(ans[i]) print ans[i] ans i N, Q = map(int, input().split()) map(int, input().split()) N Q = map(int, input().split()) map(int, input().split()) Q ans = [-1] * Q [-1] * Q ans skip = [-1] * (Q + 1) [-1] * (Q + 1) skip r = bisect_left(q, t - x) bisect_left(q, t - x) r l = bisect_left(q, s - x) bisect_left(q, s - x) l q = [int(input()) for _ in range(Q)] [int(input()) for _ in range(Q)] q l = skip[l] skip[l] l R = [tuple(map(int, input().split())) for i in range(N)] [tuple(map(int, input().split())) for i in range(N)] R l += 1 1 l
from bisect import bisect_left

N, Q = map(int, input().split())
R = [tuple(map(int, input().split())) for i in range(N)]
R.sort(key=lambda r: r[2])
q = [int(input()) for _ in range(Q)]

ans = [-1] * Q
skip = [-1] * (Q + 1)

for s, t, x in R:
    l = bisect_left(q, s - x)
    r = bisect_left(q, t - x)
    while l < r:
        if skip[l] == -1:
            skip[l] = r
            ans[l] = x
            l += 1
        else:
            l = skip[l]
for i in range(Q):
    print(ans[i])