import sys
input = sys.stdin.readline
from bisect import bisect_left
inf = float('inf')

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

res = 1
while res < Q:
    res <<= 1
N0 = res
data = [inf for _ in range(2*N0-1)]

def update(l, r, x):
    L = l + N0
    R = r + N0
    while L < R:
        if R & 1:
            R -= 1
            data[R] = min(data[R], x)
        if L & 1:
            data[L] = min(data[L], x)
            L += 1
        L >>= 1; R >>= 1

def value(k):
    k += N0
    res = data[k]
    while k != 0:
        k >>= 1
        res = min(res, data[k])
    return res


for S, T, X in STX:
    l = bisect_left(D, S-X)
    r = bisect_left(D, T-X)
    update(l, r, X)

for k in range(Q):
    ans = value(k)
    if ans == inf:
        ans = -1
    print(ans) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline from bisect import bisect_left inf = float('inf') inf float('inf') float 'inf' N, Q = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split Q list(map(int,input().split())) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split STX = [list(map(int,input().split())) for _ in range(N)] STX [list(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 D = [int(input()) for _ in range(Q)] D [int(input()) for _ in range(Q)] res = 1 res 1 while res < Q:
    res <<= 1 res < Q res Q res <<= 1 res 1 N0 = res N0 res inf for _ in range(2*N0-1) for _ in range(2*N0-1) _ range(2*N0-1) range 2*N0-1 2*N0 2 N0 1 for _ in range(2*N0-1) inf data = [inf for _ in range(2*N0-1)] data [inf for _ in range(2*N0-1)] def update(l, r, x):
    L = l + N0
    R = r + N0
    while L < R:
        if R & 1:
            R -= 1
            data[R] = min(data[R], x)
        if L & 1:
            data[L] = min(data[L], x)
            L += 1
        L >>= 1; R >>= 1 update L = l + N0 L l + N0 l N0 R = r + N0 R r + N0 r N0 while L < R:
        if R & 1:
            R -= 1
            data[R] = min(data[R], x)
        if L & 1:
            data[L] = min(data[L], x)
            L += 1
        L >>= 1; R >>= 1 L < R L R if R & 1:
            R -= 1
            data[R] = min(data[R], x)
         R & 1 R 1 R -= 1 R 1 data[R] = min(data[R], x) data[R] data R min(data[R], x) min data[R] data R x if L & 1:
            data[L] = min(data[L], x)
            L += 1
         L & 1 L 1 data[L] = min(data[L], x) data[L] data L min(data[L], x) min data[L] data L x L += 1 L 1 L >>= 1 L 1 R >>= 1 R 1 l l r r x x def value(k):
    k += N0
    res = data[k]
    while k != 0:
        k >>= 1
        res = min(res, data[k])
    return res value k += N0 k N0 res = data[k] res data[k] data k while k != 0:
        k >>= 1
        res = min(res, data[k])
     k != 0 k 0 k >>= 1 k 1 res = min(res, data[k]) res min(res, data[k]) min res data[k] data k return res res k k for S, T, X in STX:
    l = bisect_left(D, S-X)
    r = bisect_left(D, T-X)
    update(l, r, X) S T X STX l = bisect_left(D, S-X) l bisect_left(D, S-X) bisect_left D S-X S X r = bisect_left(D, T-X) r bisect_left(D, T-X) bisect_left D T-X T X update(l, r, X) update l r X for k in range(Q):
    ans = value(k)
    if ans == inf:
        ans = -1
    print(ans) k range(Q) range Q ans = value(k) ans value(k) value k if ans == inf:
        ans = -1
     ans == inf ans inf ans = -1 ans -1 print(ans) print ans def value(k):
    k += N0
    res = data[k]
    while k != 0:
        k >>= 1
        res = min(res, data[k])
    return res def value(k):
    k += N0
    res = data[k]
    while k != 0:
        k >>= 1
        res = min(res, data[k])
    return res value res = 1 1 res D = [int(input()) for _ in range(Q)] [int(input()) for _ in range(Q)] D input = sys.stdin.readline sys.stdin.readline input l = bisect_left(D, S-X) bisect_left(D, S-X) l ans = value(k) value(k) ans ans = -1 -1 ans r = bisect_left(D, T-X) bisect_left(D, T-X) r def update(l, r, x):
    L = l + N0
    R = r + N0
    while L < R:
        if R & 1:
            R -= 1
            data[R] = min(data[R], x)
        if L & 1:
            data[L] = min(data[L], x)
            L += 1
        L >>= 1; R >>= 1 def update(l, r, x):
    L = l + N0
    R = r + N0
    while L < R:
        if R & 1:
            R -= 1
            data[R] = min(data[R], x)
        if L & 1:
            data[L] = min(data[L], x)
            L += 1
        L >>= 1; R >>= 1 update res <<= 1 1 res STX = [list(map(int,input().split())) for _ in range(N)] [list(map(int,input().split())) for _ in range(N)] STX Q = map(int,input().split()) map(int,input().split()) Q N, Q = map(int,input().split()) map(int,input().split()) N N0 = res res N0 data = [inf for _ in range(2*N0-1)] [inf for _ in range(2*N0-1)] data inf = float('inf') float('inf') inf
import sys
input = sys.stdin.readline
from bisect import bisect_left
inf = float('inf')

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

res = 1
while res < Q:
    res <<= 1
N0 = res
data = [inf for _ in range(2*N0-1)]

def update(l, r, x):
    L = l + N0
    R = r + N0
    while L < R:
        if R & 1:
            R -= 1
            data[R] = min(data[R], x)
        if L & 1:
            data[L] = min(data[L], x)
            L += 1
        L >>= 1; R >>= 1

def value(k):
    k += N0
    res = data[k]
    while k != 0:
        k >>= 1
        res = min(res, data[k])
    return res


for S, T, X in STX:
    l = bisect_left(D, S-X)
    r = bisect_left(D, T-X)
    update(l, r, X)

for k in range(Q):
    ans = value(k)
    if ans == inf:
        ans = -1
    print(ans)