import bisect
N,Q=map(int,input().split())
road=[]
pos=[]
for _ in range(N):
    s,t,x=map(int,input().split())
    road.append((s-x,t-x,x))
for _ in range(Q):
    pos.append(int(input()))
road.sort(key=lambda x:x[2])
ans=[-1]*Q
ischecked=[-1]*Q
for s,t,x in road:
    l=bisect.bisect_left(pos,s)
    r=bisect.bisect_left(pos,t)
    while l<r:
        if ischecked[l]==-1:
            ischecked[l]=r
            ans[l]=x
            l+=1
        else:
            l=ischecked[l]
for i in range(Q):
    print(ans[i]) import bisect bisect N,Q=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split Q road=[] road [] pos=[] pos [] for _ in range(N):
    s,t,x=map(int,input().split())
    road.append((s-x,t-x,x)) _ 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 road.append((s-x,t-x,x)) road.append road append (s-x,t-x,x) s-x s x t-x t x x for _ in range(Q):
    pos.append(int(input())) _ range(Q) range Q pos.append(int(input())) pos.append pos append int(input()) int input() input road.sort(key=lambda x:x[2]) road.sort road sort key=lambda x:x[2] key lambda x:x[2] x[2] x 2 x ans=[-1]*Q ans [-1]*Q [-1] -1 Q ischecked=[-1]*Q ischecked [-1]*Q [-1] -1 Q for s,t,x in road:
    l=bisect.bisect_left(pos,s)
    r=bisect.bisect_left(pos,t)
    while l<r:
        if ischecked[l]==-1:
            ischecked[l]=r
            ans[l]=x
            l+=1
        else:
            l=ischecked[l] s t x road l=bisect.bisect_left(pos,s) l bisect.bisect_left(pos,s) bisect.bisect_left bisect bisect_left pos s r=bisect.bisect_left(pos,t) r bisect.bisect_left(pos,t) bisect.bisect_left bisect bisect_left pos t while l<r:
        if ischecked[l]==-1:
            ischecked[l]=r
            ans[l]=x
            l+=1
        else:
            l=ischecked[l] l<r l r if ischecked[l]==-1:
            ischecked[l]=r
            ans[l]=x
            l+=1
        else:
            l=ischecked[l] ischecked[l]==-1 ischecked[l] ischecked l -1 ischecked[l]=r ischecked[l] ischecked l r ans[l]=x ans[l] ans l x l+=1 l 1 l=ischecked[l] l ischecked[l] ischecked l for i in range(Q):
    print(ans[i]) i range(Q) range Q print(ans[i]) print ans[i] ans i pos=[] [] pos l=bisect.bisect_left(pos,s) bisect.bisect_left(pos,s) l t,x=map(int,input().split()) map(int,input().split()) t ans=[-1]*Q [-1]*Q ans Q=map(int,input().split()) map(int,input().split()) Q x=map(int,input().split()) map(int,input().split()) x r=bisect.bisect_left(pos,t) bisect.bisect_left(pos,t) r N,Q=map(int,input().split()) map(int,input().split()) N ischecked=[-1]*Q [-1]*Q ischecked s,t,x=map(int,input().split()) map(int,input().split()) s l+=1 1 l l=ischecked[l] ischecked[l] l road=[] [] road
import bisect
N,Q=map(int,input().split())
road=[]
pos=[]
for _ in range(N):
    s,t,x=map(int,input().split())
    road.append((s-x,t-x,x))
for _ in range(Q):
    pos.append(int(input()))
road.sort(key=lambda x:x[2])
ans=[-1]*Q
ischecked=[-1]*Q
for s,t,x in road:
    l=bisect.bisect_left(pos,s)
    r=bisect.bisect_left(pos,t)
    while l<r:
        if ischecked[l]==-1:
            ischecked[l]=r
            ans[l]=x
            l+=1
        else:
            l=ischecked[l]
for i in range(Q):
    print(ans[i])