from heapq import heapify,heappop,heappush
import sys
read=sys.stdin.readline
class mset:
    def __init__(self):
        self.p,self.q=[],[]
        heapify(self.p);heapify(self.q)
    def add(self,a):
        heappush(self.p,a)
    def delete(self,a):
            heappush(self.q,a)
    def minimum(self):
        while self.q and self.p[0]==self.q[0]:
            heappop(self.p);heappop(self.q)
        return self.p[0] if self.p else None

N,Q=map(int,read().split())
event=[]
for i in range(N):
    S,T,X=map(int,read().split())
    event.append((1,S-X,X))
    event.append((0,T-X,X))

s=mset()
now=0
for i in range(Q):
    D=int(read())
    event.append((2,D,0))
event.sort(key=lambda x:(x[1],x[0]))

for c,t,w in event:
    if c==0:
        s.delete(w)
    elif c==1:
        s.add(w)
    else:
        m=s.minimum()
        print(-1 if m==None else m) from heapq import heapify,heappop,heappush import sys sys read=sys.stdin.readline read sys.stdin.readline sys.stdin sys stdin readline class mset:
    def __init__(self):
        self.p,self.q=[],[]
        heapify(self.p);heapify(self.q)
    def add(self,a):
        heappush(self.p,a)
    def delete(self,a):
            heappush(self.q,a)
    def minimum(self):
        while self.q and self.p[0]==self.q[0]:
            heappop(self.p);heappop(self.q)
        return self.p[0] if self.p else None mset def __init__(self):
        self.p,self.q=[],[]
        heapify(self.p);heapify(self.q)
     __init__ self.p,self.q=[],[] self.p self p [] self.q self q [] heapify(self.p) heapify self.p self p heapify(self.q) heapify self.q self q self self def add(self,a):
        heappush(self.p,a)
     add heappush(self.p,a) heappush self.p self p a self self a a def delete(self,a):
            heappush(self.q,a)
     delete heappush(self.q,a) heappush self.q self q a self self a a def minimum(self):
        while self.q and self.p[0]==self.q[0]:
            heappop(self.p);heappop(self.q)
        return self.p[0] if self.p else None minimum while self.q and self.p[0]==self.q[0]:
            heappop(self.p);heappop(self.q)
         self.q and self.p[0]==self.q[0] self.q self q self.p[0]==self.q[0] self.p[0] self.p self p 0 self.q[0] self.q self q 0 heappop(self.p) heappop self.p self p heappop(self.q) heappop self.q self q return self.p[0] if self.p else None self.p[0] if self.p else None self.p self p self.p[0] self.p self p 0 None self self N,Q=map(int,read().split()) N map(int,read().split()) map int read().split() ().split () read split Q event=[] event [] for i in range(N):
    S,T,X=map(int,read().split())
    event.append((1,S-X,X))
    event.append((0,T-X,X)) i range(N) range N S,T,X=map(int,read().split()) S map(int,read().split()) map int read().split() ().split () read split T X event.append((1,S-X,X)) event.append event append (1,S-X,X) 1 S-X S X X event.append((0,T-X,X)) event.append event append (0,T-X,X) 0 T-X T X X s=mset() s mset() mset now=0 now 0 for i in range(Q):
    D=int(read())
    event.append((2,D,0)) i range(Q) range Q D=int(read()) D int(read()) int read() read event.append((2,D,0)) event.append event append (2,D,0) 2 D 0 event.sort(key=lambda x:(x[1],x[0])) event.sort event sort key=lambda x:(x[1],x[0]) key lambda x:(x[1],x[0]) (x[1],x[0]) x[1] x 1 x[0] x 0 x for c,t,w in event:
    if c==0:
        s.delete(w)
    elif c==1:
        s.add(w)
    else:
        m=s.minimum()
        print(-1 if m==None else m) c t w event if c==0:
        s.delete(w)
    elif c==1:
        s.add(w)
    else:
        m=s.minimum()
        print(-1 if m==None else m) c==0 c 0 s.delete(w) s.delete s delete w elif c==1:
        s.add(w)
     c==1 c 1 s.add(w) s.add s add w m=s.minimum() m s.minimum() s.minimum s minimum print(-1 if m==None else m) print -1 if m==None else m m==None m None -1 m N,Q=map(int,read().split()) map(int,read().split()) N read=sys.stdin.readline sys.stdin.readline read class mset:
    def __init__(self):
        self.p,self.q=[],[]
        heapify(self.p);heapify(self.q)
    def add(self,a):
        heappush(self.p,a)
    def delete(self,a):
            heappush(self.q,a)
    def minimum(self):
        while self.q and self.p[0]==self.q[0]:
            heappop(self.p);heappop(self.q)
        return self.p[0] if self.p else None class mset:
    def __init__(self):
        self.p,self.q=[],[]
        heapify(self.p);heapify(self.q)
    def add(self,a):
        heappush(self.p,a)
    def delete(self,a):
            heappush(self.q,a)
    def minimum(self):
        while self.q and self.p[0]==self.q[0]:
            heappop(self.p);heappop(self.q)
        return self.p[0] if self.p else None mset T,X=map(int,read().split()) map(int,read().split()) T now=0 0 now event=[] [] event s=mset() mset() s m=s.minimum() s.minimum() m X=map(int,read().split()) map(int,read().split()) X Q=map(int,read().split()) map(int,read().split()) Q D=int(read()) int(read()) D S,T,X=map(int,read().split()) map(int,read().split()) S
from heapq import heapify,heappop,heappush
import sys
read=sys.stdin.readline
class mset:
    def __init__(self):
        self.p,self.q=[],[]
        heapify(self.p);heapify(self.q)
    def add(self,a):
        heappush(self.p,a)
    def delete(self,a):
            heappush(self.q,a)
    def minimum(self):
        while self.q and self.p[0]==self.q[0]:
            heappop(self.p);heappop(self.q)
        return self.p[0] if self.p else None

N,Q=map(int,read().split())
event=[]
for i in range(N):
    S,T,X=map(int,read().split())
    event.append((1,S-X,X))
    event.append((0,T-X,X))

s=mset()
now=0
for i in range(Q):
    D=int(read())
    event.append((2,D,0))
event.sort(key=lambda x:(x[1],x[0]))

for c,t,w in event:
    if c==0:
        s.delete(w)
    elif c==1:
        s.add(w)
    else:
        m=s.minimum()
        print(-1 if m==None else m)