import sys
from collections import deque, defaultdict
import copy
import bisect
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 9)


N, Q = list(map(int, input().split()))
STX=[]
D=[]
for i in range(N):
    S, T, X = list(map(int, input().split()))
    STX.append((X, S, T))
STX = sorted(STX, key=lambda x: x[0])

for i in range(Q):
    D.append(int(input()))

skip = [-1]*Q

dist = [-1]*Q

for X, S, T in STX:
    s = S - X
    t = T - X - 1
    a = bisect.bisect_left(D, s)
    b = bisect.bisect_right(D, t)
    #print(D)
    j = a
    while j < b:
        if skip[j] == -1:
            skip[j] = b
            dist[j] = X
            j+=1
        else:
            j=skip[j]


for i in range(Q):
    print(dist[i]) import sys sys from collections import deque, defaultdict import copy copy import bisect bisect input=sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline sys.setrecursionlimit(10 ** 9) sys.setrecursionlimit sys setrecursionlimit 10 ** 9 10 9 N, Q = list(map(int, input().split())) N list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split Q STX=[] STX [] D=[] D [] for i in range(N):
    S, T, X = list(map(int, input().split()))
    STX.append((X, S, T)) i range(N) range N S, T, X = list(map(int, input().split())) S list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split T X STX.append((X, S, T)) STX.append STX append (X, S, T) X S T STX = sorted(STX, key=lambda x: x[0]) STX sorted(STX, key=lambda x: x[0]) sorted STX key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x for i in range(Q):
    D.append(int(input())) i range(Q) range Q D.append(int(input())) D.append D append int(input()) int input() input skip = [-1]*Q skip [-1]*Q [-1] -1 Q dist = [-1]*Q dist [-1]*Q [-1] -1 Q for X, S, T in STX:
    s = S - X
    t = T - X - 1
    a = bisect.bisect_left(D, s)
    b = bisect.bisect_right(D, t)
    #print(D)
    j = a
    while j < b:
        if skip[j] == -1:
            skip[j] = b
            dist[j] = X
            j+=1
        else:
            j=skip[j] X S T STX s = S - X s S - X S X t = T - X - 1 t T - X - 1 T - X T X 1 a = bisect.bisect_left(D, s) a bisect.bisect_left(D, s) bisect.bisect_left bisect bisect_left D s b = bisect.bisect_right(D, t) b bisect.bisect_right(D, t) bisect.bisect_right bisect bisect_right D t j = a j a while j < b:
        if skip[j] == -1:
            skip[j] = b
            dist[j] = X
            j+=1
        else:
            j=skip[j] j < b j b if skip[j] == -1:
            skip[j] = b
            dist[j] = X
            j+=1
        else:
            j=skip[j] skip[j] == -1 skip[j] skip j -1 skip[j] = b skip[j] skip j b dist[j] = X dist[j] dist j X j+=1 j 1 j=skip[j] j skip[j] skip j for i in range(Q):
    print(dist[i]) i range(Q) range Q print(dist[i]) print dist[i] dist i t = T - X - 1 T - X - 1 t X = list(map(int, input().split())) list(map(int, input().split())) X input=sys.stdin.readline sys.stdin.readline input N, Q = list(map(int, input().split())) list(map(int, input().split())) N b = bisect.bisect_right(D, t) bisect.bisect_right(D, t) b S, T, X = list(map(int, input().split())) list(map(int, input().split())) S skip = [-1]*Q [-1]*Q skip s = S - X S - X s j = a a j STX=[] [] STX T, X = list(map(int, input().split())) list(map(int, input().split())) T a = bisect.bisect_left(D, s) bisect.bisect_left(D, s) a STX = sorted(STX, key=lambda x: x[0]) sorted(STX, key=lambda x: x[0]) STX Q = list(map(int, input().split())) list(map(int, input().split())) Q D=[] [] D dist = [-1]*Q [-1]*Q dist j+=1 1 j j=skip[j] skip[j] j
import sys
from collections import deque, defaultdict
import copy
import bisect
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 9)


N, Q = list(map(int, input().split()))
STX=[]
D=[]
for i in range(N):
    S, T, X = list(map(int, input().split()))
    STX.append((X, S, T))
STX = sorted(STX, key=lambda x: x[0])

for i in range(Q):
    D.append(int(input()))

skip = [-1]*Q

dist = [-1]*Q

for X, S, T in STX:
    s = S - X
    t = T - X - 1
    a = bisect.bisect_left(D, s)
    b = bisect.bisect_right(D, t)
    #print(D)
    j = a
    while j < b:
        if skip[j] == -1:
            skip[j] = b
            dist[j] = X
            j+=1
        else:
            j=skip[j]


for i in range(Q):
    print(dist[i])