import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
from collections import Counter
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())

import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
from collections import Counter
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())
N, Q = map(int, input().split())
events = []
for i in range(N):
    s, t, x = map(int, input().split())
    events.append((s - x, 0, x))
    events.append((t - x, 1, x))

for i in range(Q):
    d = int(input())
    events.append((d, 2, i))

events = sorted(events)

q = [INF]
cnt = defaultdict(int)
cnt[INF] = 1
ans = [INF] * Q
for a, b, c in events:
    if b == 0:
        heapq.heappush(q, c)
        cnt[c] += 1
    if b == 1:
        cnt[c] -= 1
    if b == 2:
        while cnt[q[0]] == 0:
            heapq.heappop(q)
        if q[0] == INF:
            ans[c] = -1
        else:
            ans[c] = q[0]
for i in range(Q):
    print(ans[i]) import sys sys import itertools itertools import time time import math math import heapq heapq from collections import defaultdict from collections import Counter sys.setrecursionlimit(10 ** 7) sys.setrecursionlimit sys setrecursionlimit 10 ** 7 10 7 INF = 10 ** 18 INF 10 ** 18 10 18 MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 read = sys.stdin.buffer.read read sys.stdin.buffer.read sys.stdin.buffer sys.stdin sys stdin buffer read readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline readlines = sys.stdin.buffer.readlines readlines sys.stdin.buffer.readlines sys.stdin.buffer sys.stdin sys stdin buffer readlines import sys sys import itertools itertools import time time import math math import heapq heapq from collections import defaultdict from collections import Counter sys.setrecursionlimit(10 ** 7) sys.setrecursionlimit sys setrecursionlimit 10 ** 7 10 7 INF = 10 ** 18 INF 10 ** 18 10 18 MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 read = sys.stdin.buffer.read read sys.stdin.buffer.read sys.stdin.buffer sys.stdin sys stdin buffer read readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline readlines = sys.stdin.buffer.readlines readlines sys.stdin.buffer.readlines sys.stdin.buffer sys.stdin sys stdin buffer readlines N, Q = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split Q events = [] events [] for i in range(N):
    s, t, x = map(int, input().split())
    events.append((s - x, 0, x))
    events.append((t - x, 1, x)) i 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 events.append((s - x, 0, x)) events.append events append (s - x, 0, x) s - x s x 0 x events.append((t - x, 1, x)) events.append events append (t - x, 1, x) t - x t x 1 x for i in range(Q):
    d = int(input())
    events.append((d, 2, i)) i range(Q) range Q d = int(input()) d int(input()) int input() input events.append((d, 2, i)) events.append events append (d, 2, i) d 2 i events = sorted(events) events sorted(events) sorted events q = [INF] q [INF] INF cnt = defaultdict(int) cnt defaultdict(int) defaultdict int cnt[INF] = 1 cnt[INF] cnt INF 1 ans = [INF] * Q ans [INF] * Q [INF] INF Q for a, b, c in events:
    if b == 0:
        heapq.heappush(q, c)
        cnt[c] += 1
    if b == 1:
        cnt[c] -= 1
    if b == 2:
        while cnt[q[0]] == 0:
            heapq.heappop(q)
        if q[0] == INF:
            ans[c] = -1
        else:
            ans[c] = q[0] a b c events if b == 0:
        heapq.heappush(q, c)
        cnt[c] += 1
     b == 0 b 0 heapq.heappush(q, c) heapq.heappush heapq heappush q c cnt[c] += 1 cnt[c] cnt c 1 if b == 1:
        cnt[c] -= 1
     b == 1 b 1 cnt[c] -= 1 cnt[c] cnt c 1 if b == 2:
        while cnt[q[0]] == 0:
            heapq.heappop(q)
        if q[0] == INF:
            ans[c] = -1
        else:
            ans[c] = q[0] b == 2 b 2 while cnt[q[0]] == 0:
            heapq.heappop(q)
         cnt[q[0]] == 0 cnt[q[0]] cnt q[0] q 0 0 heapq.heappop(q) heapq.heappop heapq heappop q if q[0] == INF:
            ans[c] = -1
        else:
            ans[c] = q[0] q[0] == INF q[0] q 0 INF ans[c] = -1 ans[c] ans c -1 ans[c] = q[0] ans[c] ans c q[0] q 0 for i in range(Q):
    print(ans[i]) i range(Q) range Q print(ans[i]) print ans[i] ans i d = int(input()) int(input()) d readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD cnt = defaultdict(int) defaultdict(int) cnt readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline INF = 10 ** 18 10 ** 18 INF ans = [INF] * Q [INF] * Q ans INF = 10 ** 18 10 ** 18 INF Q = map(int, input().split()) map(int, input().split()) Q readlines = sys.stdin.buffer.readlines sys.stdin.buffer.readlines readlines x = map(int, input().split()) map(int, input().split()) x readlines = sys.stdin.buffer.readlines sys.stdin.buffer.readlines readlines N, Q = map(int, input().split()) map(int, input().split()) N q = [INF] [INF] q read = sys.stdin.buffer.read sys.stdin.buffer.read read MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD read = sys.stdin.buffer.read sys.stdin.buffer.read read s, t, x = map(int, input().split()) map(int, input().split()) s events = [] [] events t, x = map(int, input().split()) map(int, input().split()) t events = sorted(events) sorted(events) events
import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
from collections import Counter
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())

import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
from collections import Counter
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())
N, Q = map(int, input().split())
events = []
for i in range(N):
    s, t, x = map(int, input().split())
    events.append((s - x, 0, x))
    events.append((t - x, 1, x))

for i in range(Q):
    d = int(input())
    events.append((d, 2, i))

events = sorted(events)

q = [INF]
cnt = defaultdict(int)
cnt[INF] = 1
ans = [INF] * Q
for a, b, c in events:
    if b == 0:
        heapq.heappush(q, c)
        cnt[c] += 1
    if b == 1:
        cnt[c] -= 1
    if b == 2:
        while cnt[q[0]] == 0:
            heapq.heappop(q)
        if q[0] == INF:
            ans[c] = -1
        else:
            ans[c] = q[0]
for i in range(Q):
    print(ans[i])