import heapq
import sys
input=sys.stdin.readline

N,Q=map(int,input().split())
H=[]
for i in range(N):
    s,t,x=map(int,input().split())
    H.append([s-x,t-x,x])
H.sort()
#print(H)
P=0
q=[]
heapq.heapify(q)
for i in range(Q):
    n=int(input())
    #print("A",len(q))
    if P<N:
        while H[P][0]<=n:
            heapq.heappush(q,[H[P][2],H[P][0],H[P][1]])
            P+=1
            if P==N:
                break
    #print("B",i,len(q))
    if len(q)>0:
        while q[0][2]<=n:
            heapq.heappop(q)
            if len(q)==0:
                break
    if len(q)==0:
        print(-1)
    else:
        print(q[0][0]) import heapq heapq import sys sys input=sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline N,Q=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split Q H=[] H [] for i in range(N):
    s,t,x=map(int,input().split())
    H.append([s-x,t-x,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 H.append([s-x,t-x,x]) H.append H append [s-x,t-x,x] s-x s x t-x t x x H.sort() H.sort H sort P=0 P 0 q=[] q [] heapq.heapify(q) heapq.heapify heapq heapify q for i in range(Q):
    n=int(input())
    #print("A",len(q))
    if P<N:
        while H[P][0]<=n:
            heapq.heappush(q,[H[P][2],H[P][0],H[P][1]])
            P+=1
            if P==N:
                break
    #print("B",i,len(q))
    if len(q)>0:
        while q[0][2]<=n:
            heapq.heappop(q)
            if len(q)==0:
                break
    if len(q)==0:
        print(-1)
    else:
        print(q[0][0]) i range(Q) range Q n=int(input()) n int(input()) int input() input if P<N:
        while H[P][0]<=n:
            heapq.heappush(q,[H[P][2],H[P][0],H[P][1]])
            P+=1
            if P==N:
                break
    #print("B",i,len(q))
     P<N P N while H[P][0]<=n:
            heapq.heappush(q,[H[P][2],H[P][0],H[P][1]])
            P+=1
            if P==N:
                break
    #print("B",i,len(q))
     H[P][0]<=n H[P][0] [P] H P 0 n heapq.heappush(q,[H[P][2],H[P][0],H[P][1]]) heapq.heappush heapq heappush q [H[P][2],H[P][0],H[P][1]] H[P][2] [P] H P 2 H[P][0] [P] H P 0 H[P][1] [P] H P 1 P+=1 P 1 if P==N:
                break
    #print("B",i,len(q))
     P==N P N break if len(q)>0:
        while q[0][2]<=n:
            heapq.heappop(q)
            if len(q)==0:
                break
     len(q)>0 len(q) len q 0 while q[0][2]<=n:
            heapq.heappop(q)
            if len(q)==0:
                break
     q[0][2]<=n q[0][2] [0] q 0 2 n heapq.heappop(q) heapq.heappop heapq heappop q if len(q)==0:
                break
     len(q)==0 len(q) len q 0 break if len(q)==0:
        print(-1)
    else:
        print(q[0][0]) len(q)==0 len(q) len q 0 print(-1) print -1 print(q[0][0]) print q[0][0] [0] q 0 0 Q=map(int,input().split()) map(int,input().split()) Q N,Q=map(int,input().split()) map(int,input().split()) N q=[] [] q H=[] [] H s,t,x=map(int,input().split()) map(int,input().split()) s P+=1 1 P n=int(input()) int(input()) n t,x=map(int,input().split()) map(int,input().split()) t input=sys.stdin.readline sys.stdin.readline input x=map(int,input().split()) map(int,input().split()) x P=0 0 P
import heapq
import sys
input=sys.stdin.readline

N,Q=map(int,input().split())
H=[]
for i in range(N):
    s,t,x=map(int,input().split())
    H.append([s-x,t-x,x])
H.sort()
#print(H)
P=0
q=[]
heapq.heapify(q)
for i in range(Q):
    n=int(input())
    #print("A",len(q))
    if P<N:
        while H[P][0]<=n:
            heapq.heappush(q,[H[P][2],H[P][0],H[P][1]])
            P+=1
            if P==N:
                break
    #print("B",i,len(q))
    if len(q)>0:
        while q[0][2]<=n:
            heapq.heappop(q)
            if len(q)==0:
                break
    if len(q)==0:
        print(-1)
    else:
        print(q[0][0])