import sys,bisect,string,math,time,functools,random,fractions
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
rep=range;R=range
def Golf():n,*t=map(int,open(0).read().split())
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def MI():return map(int,input().split())
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def RA():return map(int,open(0).read().split())
def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in range(V)]
    FromStdin=True if ls==None else False
    for i in range(E):
        if FromStdin:
            inp=LI()
            org_inp.append(inp)
        else:
            inp=ls[i]
        if len(inp)==2:
            a,b=inp;c=1
        else:
            a,b,c=inp
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1):
    #h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1) # sample usage
    mp=[boundary]*(w+2);found={}
    for i in R(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def accum(ls):
    rt=[0]
    for i in ls:rt+=[rt[-1]+i]
    return rt
def bit_combination(n,base=2):
    rt=[]
    for tb in R(base**n):s=[tb//(base**bt)%base for bt in R(n)];rt+=[s]
    return rt
def gcd(x,y):
    if y==0:return x
    if x%y==0:return y
    while x%y!=0:x,y=y,x%y
    return y
def YN(x):print(['NO','YES'][x])
def Yn(x):print(['No','Yes'][x])
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)

mo=10**9+7
inf=float('inf')
FourNb=[(-1,0),(1,0),(0,1),(0,-1)];EightNb=[(-1,0),(1,0),(0,1),(0,-1),(1,1),(-1,-1),(1,-1),(-1,1)];compas=dict(zip('WENS',FourNb));cursol=dict(zip('LRUD',FourNb))
l_alp=string.ascii_lowercase
#sys.setrecursionlimit(10**7)
read=sys.stdin.buffer.read;readline=sys.stdin.buffer.readline;input=lambda:sys.stdin.readline().rstrip()

########################################################################################################################################################################

# Binary Indexed Tree
# Bit.add(i,x)    : add x at i-th value
# Bit.sum(i)      : get sum up to i-th value



show_flg=False
#show_flg=True

ans=0

a=[]
n,q=LI()
for i in range(n):
    s,t,x=LI()
    a+=(x,(s-x,t-x)),
a.sort(key=lambda x:-x[1][0])

d=NI(q)

p=[]
g=[]
for i in range(q):
    c=d[i]
    while a and a[-1][1][0]<=c:
        x,(l,r)=a.pop()
        heappush(p,(x,(l,r)))
    
    while p and p[0][1][1]<=c:
        x,(l,r)=heappop(p)

    if p:
        ans=p[0][0]
    else:
        ans=-1
    g+=ans,

for i in g:
    print(i) import sys,bisect,string,math,time,functools,random,fractions sys bisect string math time functools random fractions from heapq import heappush,heappop,heapify from collections import deque,defaultdict,Counter from itertools import permutations,combinations,groupby rep=range rep range R=range R range def Golf():n,*t=map(int,open(0).read().split()) Golf def I():return int(input()) I def S_():return input() S_ def IS():return input().split() IS i for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() i def LS():return [i for i in input().split()] LS def MI():return map(int,input().split()) MI int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i def LI():return [int(i) for i in input().split()] LI int(i)-1 for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i)-1 int(i) int i 1 def LI_():return [int(i)-1 for i in input().split()] LI_ int(input()) for i in range(n) for i in range(n) i range(n) range n for i in range(n) int(input()) int input() input def NI(n):return [int(input()) for i in range(n)] NI n n int(input())-1 for i in range(n) for i in range(n) i range(n) range n for i in range(n) int(input())-1 int(input()) int input() input 1 def NI_(n):return [int(input())-1 for i in range(n)] NI_ n n ord(i)-97 for i in input() for i in input() i input() input for i in input() ord(i)-97 ord(i) ord i 97 def StoLI():return [ord(i)-97 for i in input()] StoLI def ItoS(n):return chr(n+97) ItoS n n chr(i+97) for i in ls for i in ls i ls for i in ls chr(i+97) chr i+97 i 97 def LtoS(ls):return ''.join([chr(i+97) for i in ls]) LtoS ls ls def RA():return map(int,open(0).read().split()) RA def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in range(V)]
    FromStdin=True if ls==None else False
    for i in range(E):
        if FromStdin:
            inp=LI()
            org_inp.append(inp)
        else:
            inp=ls[i]
        if len(inp)==2:
            a,b=inp;c=1
        else:
            a,b,c=inp
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp GI [] for i in range(V) for i in range(V) i range(V) range V for i in range(V) [] org_inp=[] org_inp [] g=[[] for i in range(V)] g [[] for i in range(V)] FromStdin=True if ls==None else False FromStdin True if ls==None else False ls==None ls None True False for i in range(E):
        if FromStdin:
            inp=LI()
            org_inp.append(inp)
        else:
            inp=ls[i]
        if len(inp)==2:
            a,b=inp;c=1
        else:
            a,b,c=inp
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
     i range(E) range E if FromStdin:
            inp=LI()
            org_inp.append(inp)
        else:
            inp=ls[i]
         FromStdin inp=LI() inp LI() LI org_inp.append(inp) org_inp.append org_inp append inp inp=ls[i] inp ls[i] ls i if len(inp)==2:
            a,b=inp;c=1
        else:
            a,b,c=inp
         len(inp)==2 len(inp) len inp 2 a,b=inp a inp b c=1 c 1 a,b,c=inp a inp b c if index==1:a-=1;b-=1
         index==1 index 1 aa=(a,c) aa (a,c) a c bb=(b,c) bb (b,c) b c g[a].append(bb) [a].append [a] g a append bb if not Directed:g[b].append(aa)
     not Directed Directed return g,org_inp return g,org_inp g org_inp V V E E ls=None ls None Directed=False Directed False index=1 index 1 def GGI(h,w,search=None,replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1):
    #h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1) # sample usage
    mp=[boundary]*(w+2);found={}
    for i in R(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found GGI mp=[boundary]*(w+2) mp [boundary]*(w+2) [boundary] boundary w+2 w 2 found={} found {} for i in R(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
     i R(h) R h s=input() s input() input for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
         char search if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
         char in s char s found[char]=((i+1)*(w+2)+s.index(char)+1) found[char] found char (i+1)*(w+2)+s.index(char)+1 (i+1)*(w+2)+s.index(char) (i+1)*(w+2) i+1 i 1 w+2 w 2 s.index(char) s.index s index char 1 mp_def[char]=mp_def[replacement_of_found] mp_def[char] mp_def char mp_def[replacement_of_found] mp_def replacement_of_found mp_def[j] for j in s for j in s j s for j in s mp_def[j] mp_def j mp+=[boundary]+[mp_def[j] for j in s]+[boundary] mp [boundary]+[mp_def[j] for j in s]+[boundary] [boundary]+[mp_def[j] for j in s] [boundary] boundary [mp_def[j] for j in s] [boundary] boundary mp+=[boundary]*(w+2) mp [boundary]*(w+2) [boundary] boundary w+2 w 2 return h+2,w+2,mp,found return h+2,w+2,mp,found h+2 h 2 w+2 w 2 mp found h h w w search=None search None replacement_of_found='.' replacement_of_found '.' mp_def={'#':1,'.':0} mp_def {'#':1,'.':0} '#' '#' 1 '.' '.' 0 boundary=1 boundary 1 def TI(n):return GI(n,n-1) TI n n def accum(ls):
    rt=[0]
    for i in ls:rt+=[rt[-1]+i]
    return rt accum rt=[0] rt [0] 0 for i in ls:rt+=[rt[-1]+i]
     i ls return rt rt ls ls def bit_combination(n,base=2):
    rt=[]
    for tb in R(base**n):s=[tb//(base**bt)%base for bt in R(n)];rt+=[s]
    return rt bit_combination rt=[] rt [] tb//(base**bt)%base for bt in R(n) for bt in R(n) bt R(n) R n for bt in R(n) tb//(base**bt)%base tb//(base**bt) tb base**bt base bt base for tb in R(base**n):s=[tb//(base**bt)%base for bt in R(n)];rt+=[s]
     tb R(base**n) R base**n base n return rt rt n n base=2 base 2 def gcd(x,y):
    if y==0:return x
    if x%y==0:return y
    while x%y!=0:x,y=y,x%y
    return y gcd if y==0:return x
     y==0 y 0 if x%y==0:return y
     x%y==0 x%y x y 0 while x%y!=0:x,y=y,x%y
     x%y!=0 x%y x y 0 return y y x x y y def YN(x):print(['NO','YES'][x]) YN x x def Yn(x):print(['No','Yes'][x]) Yn x x def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end) show if show_flg:print(*inp,end= show_flg end='\n' end '\n' *inp mo=10**9+7 mo 10**9+7 10**9 10 9 7 inf=float('inf') inf float('inf') float 'inf' FourNb=[(-1,0),(1,0),(0,1),(0,-1)] FourNb [(-1,0),(1,0),(0,1),(0,-1)] (-1,0) -1 0 (1,0) 1 0 (0,1) 0 1 (0,-1) 0 -1 EightNb=[(-1,0),(1,0),(0,1),(0,-1),(1,1),(-1,-1),(1,-1),(-1,1)] EightNb [(-1,0),(1,0),(0,1),(0,-1),(1,1),(-1,-1),(1,-1),(-1,1)] (-1,0) -1 0 (1,0) 1 0 (0,1) 0 1 (0,-1) 0 -1 (1,1) 1 1 (-1,-1) -1 -1 (1,-1) 1 -1 (-1,1) -1 1 compas=dict(zip('WENS',FourNb)) compas dict(zip('WENS',FourNb)) dict zip('WENS',FourNb) zip 'WENS' FourNb cursol=dict(zip('LRUD',FourNb)) cursol dict(zip('LRUD',FourNb)) dict zip('LRUD',FourNb) zip 'LRUD' FourNb l_alp=string.ascii_lowercase l_alp string.ascii_lowercase string ascii_lowercase read=sys.stdin.buffer.read read sys.stdin.buffer.read sys.stdin.buffer sys.stdin sys stdin buffer read readline=sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline input=lambda:sys.stdin.readline().rstrip() input lambda:sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip show_flg=False show_flg False ans=0 ans 0 a=[] a [] n,q=LI() n LI() LI q for i in range(n):
    s,t,x=LI()
    a+=(x,(s-x,t-x)), i range(n) range n s,t,x=LI() s LI() LI t x a+=(x,(s-x,t-x)), a (x,(s-x,t-x)) x (s-x,t-x) s-x s x t-x t x a.sort(key=lambda x:-x[1][0]) a.sort a sort key=lambda x:-x[1][0] key lambda x:-x[1][0] -x[1][0] x[1][0] [1] x 1 0 x d=NI(q) d NI(q) NI q p=[] p [] g=[] g [] for i in range(q):
    c=d[i]
    while a and a[-1][1][0]<=c:
        x,(l,r)=a.pop()
        heappush(p,(x,(l,r)))
    
    while p and p[0][1][1]<=c:
        x,(l,r)=heappop(p)

    if p:
        ans=p[0][0]
    else:
        ans=-1
    g+=ans, i range(q) range q c=d[i] c d[i] d i while a and a[-1][1][0]<=c:
        x,(l,r)=a.pop()
        heappush(p,(x,(l,r)))
    
     a and a[-1][1][0]<=c a a[-1][1][0]<=c a[-1][1][0] [1] [-1] a -1 1 0 c x,(l,r)=a.pop() x a.pop() a.pop a pop (l,r) l r heappush(p,(x,(l,r))) heappush p (x,(l,r)) x (l,r) l r while p and p[0][1][1]<=c:
        x,(l,r)=heappop(p)

     p and p[0][1][1]<=c p p[0][1][1]<=c p[0][1][1] [1] [0] p 0 1 1 c x,(l,r)=heappop(p) x heappop(p) heappop p (l,r) l r if p:
        ans=p[0][0]
    else:
        ans=-1
     p ans=p[0][0] ans p[0][0] [0] p 0 0 ans=-1 ans -1 g+=ans, g ans for i in g:
    print(i) i g print(i) print i ans=p[0][0] p[0][0] ans def MI():return map(int,input().split()) def MI():return map(int,input().split()) MI def Yn(x):print(['No','Yes'][x]) def Yn(x):print(['No','Yes'][x]) Yn def Golf():n,*t=map(int,open(0).read().split()) def Golf():n,*t=map(int,open(0).read().split()) Golf def LS():return [i for i in input().split()] def LS():return [i for i in input().split()] LS def LtoS(ls):return ''.join([chr(i+97) for i in ls]) def LtoS(ls):return ''.join([chr(i+97) for i in ls]) LtoS c=d[i] d[i] c l_alp=string.ascii_lowercase string.ascii_lowercase l_alp p=[] [] p x=LI() LI() x def accum(ls):
    rt=[0]
    for i in ls:rt+=[rt[-1]+i]
    return rt def accum(ls):
    rt=[0]
    for i in ls:rt+=[rt[-1]+i]
    return rt accum mo=10**9+7 10**9+7 mo def LI():return [int(i) for i in input().split()] def LI():return [int(i) for i in input().split()] LI readline=sys.stdin.buffer.readline sys.stdin.buffer.readline readline g+=ans, ans g def IS():return input().split() def IS():return input().split() IS def LI_():return [int(i)-1 for i in input().split()] def LI_():return [int(i)-1 for i in input().split()] LI_ def I():return int(input()) def I():return int(input()) I FourNb=[(-1,0),(1,0),(0,1),(0,-1)] [(-1,0),(1,0),(0,1),(0,-1)] FourNb s,t,x=LI() LI() s def NI_(n):return [int(input())-1 for i in range(n)] def NI_(n):return [int(input())-1 for i in range(n)] NI_ def ItoS(n):return chr(n+97) def ItoS(n):return chr(n+97) ItoS rep=range range rep q=LI() LI() q def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in range(V)]
    FromStdin=True if ls==None else False
    for i in range(E):
        if FromStdin:
            inp=LI()
            org_inp.append(inp)
        else:
            inp=ls[i]
        if len(inp)==2:
            a,b=inp;c=1
        else:
            a,b,c=inp
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in range(V)]
    FromStdin=True if ls==None else False
    for i in range(E):
        if FromStdin:
            inp=LI()
            org_inp.append(inp)
        else:
            inp=ls[i]
        if len(inp)==2:
            a,b=inp;c=1
        else:
            a,b,c=inp
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp GI a+=(x,(s-x,t-x)), (x,(s-x,t-x)) a x,(l,r)=heappop(p) heappop(p) x a=[] [] a def StoLI():return [ord(i)-97 for i in input()] def StoLI():return [ord(i)-97 for i in input()] StoLI t,x=LI() LI() t n,q=LI() LI() n inf=float('inf') float('inf') inf def TI(n):return GI(n,n-1) def TI(n):return GI(n,n-1) TI def YN(x):print(['NO','YES'][x]) def YN(x):print(['NO','YES'][x]) YN EightNb=[(-1,0),(1,0),(0,1),(0,-1),(1,1),(-1,-1),(1,-1),(-1,1)] [(-1,0),(1,0),(0,1),(0,-1),(1,1),(-1,-1),(1,-1),(-1,1)] EightNb d=NI(q) NI(q) d ans=0 0 ans def gcd(x,y):
    if y==0:return x
    if x%y==0:return y
    while x%y!=0:x,y=y,x%y
    return y def gcd(x,y):
    if y==0:return x
    if x%y==0:return y
    while x%y!=0:x,y=y,x%y
    return y gcd input=lambda:sys.stdin.readline().rstrip() lambda:sys.stdin.readline().rstrip() input def S_():return input() def S_():return input() S_ def RA():return map(int,open(0).read().split()) def RA():return map(int,open(0).read().split()) RA def GGI(h,w,search=None,replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1):
    #h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1) # sample usage
    mp=[boundary]*(w+2);found={}
    for i in R(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found def GGI(h,w,search=None,replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1):
    #h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1) # sample usage
    mp=[boundary]*(w+2);found={}
    for i in R(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found GGI ans=-1 -1 ans show_flg=False False show_flg cursol=dict(zip('LRUD',FourNb)) dict(zip('LRUD',FourNb)) cursol compas=dict(zip('WENS',FourNb)) dict(zip('WENS',FourNb)) compas read=sys.stdin.buffer.read sys.stdin.buffer.read read R=range range R def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end) def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end) show g=[] [] g def NI(n):return [int(input()) for i in range(n)] def NI(n):return [int(input()) for i in range(n)] NI x,(l,r)=a.pop() a.pop() x def bit_combination(n,base=2):
    rt=[]
    for tb in R(base**n):s=[tb//(base**bt)%base for bt in R(n)];rt+=[s]
    return rt def bit_combination(n,base=2):
    rt=[]
    for tb in R(base**n):s=[tb//(base**bt)%base for bt in R(n)];rt+=[s]
    return rt bit_combination
import sys,bisect,string,math,time,functools,random,fractions
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
rep=range;R=range
def Golf():n,*t=map(int,open(0).read().split())
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def MI():return map(int,input().split())
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def RA():return map(int,open(0).read().split())
def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in range(V)]
    FromStdin=True if ls==None else False
    for i in range(E):
        if FromStdin:
            inp=LI()
            org_inp.append(inp)
        else:
            inp=ls[i]
        if len(inp)==2:
            a,b=inp;c=1
        else:
            a,b,c=inp
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1):
    #h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1) # sample usage
    mp=[boundary]*(w+2);found={}
    for i in R(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def accum(ls):
    rt=[0]
    for i in ls:rt+=[rt[-1]+i]
    return rt
def bit_combination(n,base=2):
    rt=[]
    for tb in R(base**n):s=[tb//(base**bt)%base for bt in R(n)];rt+=[s]
    return rt
def gcd(x,y):
    if y==0:return x
    if x%y==0:return y
    while x%y!=0:x,y=y,x%y
    return y
def YN(x):print(['NO','YES'][x])
def Yn(x):print(['No','Yes'][x])
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)

mo=10**9+7
inf=float('inf')
FourNb=[(-1,0),(1,0),(0,1),(0,-1)];EightNb=[(-1,0),(1,0),(0,1),(0,-1),(1,1),(-1,-1),(1,-1),(-1,1)];compas=dict(zip('WENS',FourNb));cursol=dict(zip('LRUD',FourNb))
l_alp=string.ascii_lowercase
#sys.setrecursionlimit(10**7)
read=sys.stdin.buffer.read;readline=sys.stdin.buffer.readline;input=lambda:sys.stdin.readline().rstrip()

########################################################################################################################################################################

# Binary Indexed Tree
# Bit.add(i,x)    : add x at i-th value
# Bit.sum(i)      : get sum up to i-th value



show_flg=False
#show_flg=True

ans=0

a=[]
n,q=LI()
for i in range(n):
    s,t,x=LI()
    a+=(x,(s-x,t-x)),
a.sort(key=lambda x:-x[1][0])

d=NI(q)

p=[]
g=[]
for i in range(q):
    c=d[i]
    while a and a[-1][1][0]<=c:
        x,(l,r)=a.pop()
        heappush(p,(x,(l,r)))
    
    while p and p[0][1][1]<=c:
        x,(l,r)=heappop(p)

    if p:
        ans=p[0][0]
    else:
        ans=-1
    g+=ans,

for i in g:
    print(i)