N,Q=map(int,input().split())
import sys
def input(): return sys.stdin.readline().strip()
STX=[list(map(int,input().split())) for i in range(N)]
D=[int(input()) for i in range(Q)]
X=[]
for s,t,x in STX:
    X.append((s-x,1,x))
    X.append((t-x,-1,x))
X.sort(key=lambda x:x[0])
a=0
k=[]
from heapq import heappop,heappush
kd={}
for x in X:
    while a<Q and D[a]<x[0]:
        if len(k)>0:
            print(k[0])
        else:
            print(-1)
        a+=1
    if x[1]==1:
        heappush(k,x[2])
        if x[2] in kd:
            kd[x[2]]=0
    else:
        kd[x[2]]=1
        while len(k)>0 and k[0] in kd and kd[k[0]]==1:
            heappop(k)
while a<Q:
    print(-1)
    a+=1 N,Q=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split Q import sys sys def input(): return sys.stdin.readline().strip() input list(map(int,input().split())) for i in range(N) for i in range(N) i range(N) range N for i 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 i in range(N)] STX [list(map(int,input().split())) for i in range(N)] int(input()) for i in range(Q) for i in range(Q) i range(Q) range Q for i in range(Q) int(input()) int input() input D=[int(input()) for i in range(Q)] D [int(input()) for i in range(Q)] X=[] X [] for s,t,x in STX:
    X.append((s-x,1,x))
    X.append((t-x,-1,x)) s t x STX X.append((s-x,1,x)) X.append X append (s-x,1,x) s-x s x 1 x X.append((t-x,-1,x)) X.append X append (t-x,-1,x) t-x t x -1 x X.sort(key=lambda x:x[0]) X.sort X sort key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x a=0 a 0 k=[] k [] from heapq import heappop,heappush kd={} kd {} for x in X:
    while a<Q and D[a]<x[0]:
        if len(k)>0:
            print(k[0])
        else:
            print(-1)
        a+=1
    if x[1]==1:
        heappush(k,x[2])
        if x[2] in kd:
            kd[x[2]]=0
    else:
        kd[x[2]]=1
        while len(k)>0 and k[0] in kd and kd[k[0]]==1:
            heappop(k) x X while a<Q and D[a]<x[0]:
        if len(k)>0:
            print(k[0])
        else:
            print(-1)
        a+=1
     a<Q and D[a]<x[0] a<Q a Q D[a]<x[0] D[a] D a x[0] x 0 if len(k)>0:
            print(k[0])
        else:
            print(-1)
         len(k)>0 len(k) len k 0 print(k[0]) print k[0] k 0 print(-1) print -1 a+=1 a 1 if x[1]==1:
        heappush(k,x[2])
        if x[2] in kd:
            kd[x[2]]=0
    else:
        kd[x[2]]=1
        while len(k)>0 and k[0] in kd and kd[k[0]]==1:
            heappop(k) x[1]==1 x[1] x 1 1 heappush(k,x[2]) heappush k x[2] x 2 if x[2] in kd:
            kd[x[2]]=0
     x[2] in kd x[2] x 2 kd kd[x[2]]=0 kd[x[2]] kd x[2] x 2 0 kd[x[2]]=1 kd[x[2]] kd x[2] x 2 1 while len(k)>0 and k[0] in kd and kd[k[0]]==1:
            heappop(k) len(k)>0 and k[0] in kd and kd[k[0]]==1 len(k)>0 and k[0] in kd len(k)>0 len(k) len k 0 k[0] in kd k[0] k 0 kd kd[k[0]]==1 kd[k[0]] kd k[0] k 0 1 heappop(k) heappop k while a<Q:
    print(-1)
    a+=1 a<Q a Q print(-1) print -1 a+=1 a 1 STX=[list(map(int,input().split())) for i in range(N)] [list(map(int,input().split())) for i in range(N)] STX a+=1 1 a N,Q=map(int,input().split()) map(int,input().split()) N k=[] [] k def input(): return sys.stdin.readline().strip() def input(): return sys.stdin.readline().strip() input D=[int(input()) for i in range(Q)] [int(input()) for i in range(Q)] D kd={} {} kd a+=1 1 a X=[] [] X Q=map(int,input().split()) map(int,input().split()) Q a=0 0 a
N,Q=map(int,input().split())
import sys
def input(): return sys.stdin.readline().strip()
STX=[list(map(int,input().split())) for i in range(N)]
D=[int(input()) for i in range(Q)]
X=[]
for s,t,x in STX:
    X.append((s-x,1,x))
    X.append((t-x,-1,x))
X.sort(key=lambda x:x[0])
a=0
k=[]
from heapq import heappop,heappush
kd={}
for x in X:
    while a<Q and D[a]<x[0]:
        if len(k)>0:
            print(k[0])
        else:
            print(-1)
        a+=1
    if x[1]==1:
        heappush(k,x[2])
        if x[2] in kd:
            kd[x[2]]=0
    else:
        kd[x[2]]=1
        while len(k)>0 and k[0] in kd and kd[k[0]]==1:
            heappop(k)
while a<Q:
    print(-1)
    a+=1