import sys
from heapq import heappush, heappop


I = sys.stdin.readlines()
N, Q = map(int, I[0].split())
P = []
for i in range(1, N + 1):
    s, t, x = map(int, I[i].split())
    P.append((s - x, t - 1 - x, x))
P.sort()


q = []
cur = 0
cnt = 0
for i in range(N + 1, N + Q + 1):
    d = int(I[i])
    while cur < N and P[cur][0] <= d:
        s, t, x = P[cur]
        heappush(q, (x, t))
        cnt += 1
        cur += 1
    ans = -1
    while cnt:
        if d <= q[0][1]:
            ans = q[0][0]
            break
        else:
            heappop(q)
            cnt -= 1
    print(ans)
 import sys sys from heapq import heappush, heappop I = sys.stdin.readlines() I sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines N, Q = map(int, I[0].split()) N map(int, I[0].split()) map int I[0].split() [0].split [0] I 0 split Q P = [] P [] for i in range(1, N + 1):
    s, t, x = map(int, I[i].split())
    P.append((s - x, t - 1 - x, x)) i range(1, N + 1) range 1 N + 1 N 1 s, t, x = map(int, I[i].split()) s map(int, I[i].split()) map int I[i].split() [i].split [i] I i split t x P.append((s - x, t - 1 - x, x)) P.append P append (s - x, t - 1 - x, x) s - x s x t - 1 - x t - 1 t 1 x x P.sort() P.sort P sort q = [] q [] cur = 0 cur 0 cnt = 0 cnt 0 for i in range(N + 1, N + Q + 1):
    d = int(I[i])
    while cur < N and P[cur][0] <= d:
        s, t, x = P[cur]
        heappush(q, (x, t))
        cnt += 1
        cur += 1
    ans = -1
    while cnt:
        if d <= q[0][1]:
            ans = q[0][0]
            break
        else:
            heappop(q)
            cnt -= 1
    print(ans) i range(N + 1, N + Q + 1) range N + 1 N 1 N + Q + 1 N + Q N Q 1 d = int(I[i]) d int(I[i]) int I[i] I i while cur < N and P[cur][0] <= d:
        s, t, x = P[cur]
        heappush(q, (x, t))
        cnt += 1
        cur += 1
     cur < N and P[cur][0] <= d cur < N cur N P[cur][0] <= d P[cur][0] [cur] P cur 0 d s, t, x = P[cur] s P[cur] P cur t x heappush(q, (x, t)) heappush q (x, t) x t cnt += 1 cnt 1 cur += 1 cur 1 ans = -1 ans -1 while cnt:
        if d <= q[0][1]:
            ans = q[0][0]
            break
        else:
            heappop(q)
            cnt -= 1
     cnt if d <= q[0][1]:
            ans = q[0][0]
            break
        else:
            heappop(q)
            cnt -= 1
     d <= q[0][1] d q[0][1] [0] q 0 1 ans = q[0][0] ans q[0][0] [0] q 0 0 break heappop(q) heappop q cnt -= 1 cnt 1 print(ans) print ans s, t, x = P[cur] P[cur] s s, t, x = map(int, I[i].split()) map(int, I[i].split()) s cnt = 0 0 cnt ans = q[0][0] q[0][0] ans cur += 1 1 cur Q = map(int, I[0].split()) map(int, I[0].split()) Q cnt -= 1 1 cnt I = sys.stdin.readlines() sys.stdin.readlines() I ans = -1 -1 ans d = int(I[i]) int(I[i]) d x = P[cur] P[cur] x t, x = P[cur] P[cur] t N, Q = map(int, I[0].split()) map(int, I[0].split()) N cur = 0 0 cur cnt += 1 1 cnt t, x = map(int, I[i].split()) map(int, I[i].split()) t x = map(int, I[i].split()) map(int, I[i].split()) x q = [] [] q P = [] [] P
import sys
from heapq import heappush, heappop


I = sys.stdin.readlines()
N, Q = map(int, I[0].split())
P = []
for i in range(1, N + 1):
    s, t, x = map(int, I[i].split())
    P.append((s - x, t - 1 - x, x))
P.sort()


q = []
cur = 0
cnt = 0
for i in range(N + 1, N + Q + 1):
    d = int(I[i])
    while cur < N and P[cur][0] <= d:
        s, t, x = P[cur]
        heappush(q, (x, t))
        cnt += 1
        cur += 1
    ans = -1
    while cnt:
        if d <= q[0][1]:
            ans = q[0][0]
            break
        else:
            heappop(q)
            cnt -= 1
    print(ans)

