import sys
input=sys.stdin.readline
def N(): return int(input())
def NM():return map(int,input().split())
def L():return list(NM())
def LN(n):return [N() for i in range(n)]
def LL(n):return [L() for i in range(n)]
def YesNo(x):print("Yes")if x==True else print("No")
n,q=NM()
l=[]
for i in range(n):
    s,t,x=NM()
    l.append((s-x,t-x,x))
l.sort()
INF=float("inf")
l+=[(INF,INF,INF)]
d=LN(q)
q=[]
from heapq import heappush,heappop
j=0
for i in d:
    while l[j][0]<=i:
        s,t,x=l[j]
        heappush(q,(x,t))
        j+=1
    if len(q)==0:
        print(-1)
    else:
        while q:
            x,t=heappop(q)
            if t>i:
                heappush(q,(x,t))
                print(x)
                break
        else:
            print(-1) import sys sys input=sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def N(): return int(input()) N def NM():return map(int,input().split()) NM def L():return list(NM()) L N() for i in range(n) for i in range(n) i range(n) range n for i in range(n) N() N def LN(n):return [N() for i in range(n)] LN n n L() for i in range(n) for i in range(n) i range(n) range n for i in range(n) L() L def LL(n):return [L() for i in range(n)] LL n n def YesNo(x):print("Yes")if x==True else print("No") YesNo x x n,q=NM() n NM() NM q l=[] l [] for i in range(n):
    s,t,x=NM()
    l.append((s-x,t-x,x)) i range(n) range n s,t,x=NM() s NM() NM t x l.append((s-x,t-x,x)) l.append l append (s-x,t-x,x) s-x s x t-x t x x l.sort() l.sort l sort INF=float("inf") INF float("inf") float "inf" l+=[(INF,INF,INF)] l [(INF,INF,INF)] (INF,INF,INF) INF INF INF d=LN(q) d LN(q) LN q q=[] q [] from heapq import heappush,heappop j=0 j 0 for i in d:
    while l[j][0]<=i:
        s,t,x=l[j]
        heappush(q,(x,t))
        j+=1
    if len(q)==0:
        print(-1)
    else:
        while q:
            x,t=heappop(q)
            if t>i:
                heappush(q,(x,t))
                print(x)
                break
        else:
            print(-1) i d while l[j][0]<=i:
        s,t,x=l[j]
        heappush(q,(x,t))
        j+=1
     l[j][0]<=i l[j][0] [j] l j 0 i s,t,x=l[j] s l[j] l j t x heappush(q,(x,t)) heappush q (x,t) x t j+=1 j 1 if len(q)==0:
        print(-1)
    else:
        while q:
            x,t=heappop(q)
            if t>i:
                heappush(q,(x,t))
                print(x)
                break
        else:
            print(-1) len(q)==0 len(q) len q 0 print(-1) print -1 while q:
            x,t=heappop(q)
            if t>i:
                heappush(q,(x,t))
                print(x)
                break
        else:
            print(-1) q x,t=heappop(q) x heappop(q) heappop q t if t>i:
                heappush(q,(x,t))
                print(x)
                break
         t>i t i heappush(q,(x,t)) heappush q (x,t) x t print(x) print x break print(-1) print -1 j=0 0 j q=[] [] q x=l[j] l[j] x l=[] [] l t,x=NM() NM() t t=heappop(q) heappop(q) t d=LN(q) LN(q) d input=sys.stdin.readline sys.stdin.readline input def NM():return map(int,input().split()) def NM():return map(int,input().split()) NM x=NM() NM() x t,x=l[j] l[j] t def N(): return int(input()) def N(): return int(input()) N def LL(n):return [L() for i in range(n)] def LL(n):return [L() for i in range(n)] LL n,q=NM() NM() n s,t,x=NM() NM() s def YesNo(x):print("Yes")if x==True else print("No") def YesNo(x):print("Yes")if x==True else print("No") YesNo def LN(n):return [N() for i in range(n)] def LN(n):return [N() for i in range(n)] LN INF=float("inf") float("inf") INF def L():return list(NM()) def L():return list(NM()) L j+=1 1 j x,t=heappop(q) heappop(q) x l+=[(INF,INF,INF)] [(INF,INF,INF)] l q=NM() NM() q s,t,x=l[j] l[j] s
import sys
input=sys.stdin.readline
def N(): return int(input())
def NM():return map(int,input().split())
def L():return list(NM())
def LN(n):return [N() for i in range(n)]
def LL(n):return [L() for i in range(n)]
def YesNo(x):print("Yes")if x==True else print("No")
n,q=NM()
l=[]
for i in range(n):
    s,t,x=NM()
    l.append((s-x,t-x,x))
l.sort()
INF=float("inf")
l+=[(INF,INF,INF)]
d=LN(q)
q=[]
from heapq import heappush,heappop
j=0
for i in d:
    while l[j][0]<=i:
        s,t,x=l[j]
        heappush(q,(x,t))
        j+=1
    if len(q)==0:
        print(-1)
    else:
        while q:
            x,t=heappop(q)
            if t>i:
                heappush(q,(x,t))
                print(x)
                break
        else:
            print(-1)