# coding: utf-8
import re
import math
import fractions
import random
from heapq import heappop,heappush
import time
import sys
input = sys.stdin.readline
#import numpy as np
mod=int(10**9+7)
inf=int(10**20)
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def comb(n,r):return math.factorial(n)//math.factorial(n-r)//math.factorial(r)
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
 

 
#main
N,Q=map(int,input().split())
E=[]
for a in range(N):
    s,t,x=map(int,input().split())
    E.append((s-x,1,x))
    E.append((t-x,0,x))

for a in range(Q):
    E.append((int(input()),2,0))
E.sort()
 
S=set()
H=[]
for time_,type_,x in E:
    if type_==1:
        S.add(x)
        heappush(H,x)
    elif type_==0:
        S.remove(x)
    else:
        while H and H[0] not in S:
            heappop(H)
        print(H[0] if H else -1) import re re import math math import fractions fractions import random random from heapq import heappop,heappush import time time import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline mod=int(10**9+7) mod int(10**9+7) int 10**9+7 10**9 10 9 7 inf=int(10**20) inf int(10**20) int 10**20 10 20 class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S) union_find def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
     __init__ self.n=n self.n self n n a for a in range(N) for a in range(N) a range(N) range N for a in range(N) a self.P=[a for a in range(N)] self.P self P [a for a in range(N)] self.rank=[0]*n self.rank self rank [0]*n [0] 0 n self self n n def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
     find if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
         x!=self.P[x] x self.P[x] self.P self P x return self.P[x] self.P[x] self.P self P x self self x x def same(self,x,y):
        return self.find(x)==self.find(y)
 
     same return self.find(x)==self.find(y) self.find(x)==self.find(y) self.find(x) self.find self find x self.find(y) self.find self find y self self x x y y def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
     link if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
     self.rank[x]<self.rank[y] self.rank[x] self.rank self rank x self.rank[y] self.rank self rank y self.P[x]=y self.P[x] self.P self P x y elif self.rank[y]<self.rank[x]:
            self.P[y]=x
         self.rank[y]<self.rank[x] self.rank[y] self.rank self rank y self.rank[x] self.rank self rank x self.P[y]=x self.P[y] self.P self P y x self.P[x]=y self.P[x] self.P self P x y self.rank[y]+=1 self.rank[y] self.rank self rank y 1 self self x x y y def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
     unite self.link(self.find(x),self.find(y)) self.link self link self.find(x) self.find self find x self.find(y) self.find self find y self self x x y y def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S) size S=set() S set() set for a in range(self.n):
            S.add(self.find(a))
         a range(self.n) range self.n self n S.add(self.find(a)) S.add S add self.find(a) self.find self find a return len(S) len(S) len S self self def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A bin_ A=[0]*size A [0]*size [0] 0 size for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
     a range(size) range size if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
     (num>>(size-a-1))&1==1 (num>>(size-a-1))&1 num>>(size-a-1) num size-a-1 size-a size a 1 1 1 A[a]=1 A[a] A a 1 A[a]=0 A[a] A a 0 return A A num num size size def comb(n,r):return math.factorial(n)//math.factorial(n-r)//math.factorial(r) comb n n r r def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
 

 
#main next_comb x=num&(-num) x num&(-num) num -num num y=num+x y num+x num x z=num&(~y) z num&(~y) num ~y y z//=x z x z=z>>1 z z>>1 z 1 num=(y|z) num y|z y z if(num>=(1<<size)):return False
    else:
        return num
 

 
#main num>=(1<<size) num 1<<size 1 size return num num num num size size N,Q=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split Q E=[] E [] for a in range(N):
    s,t,x=map(int,input().split())
    E.append((s-x,1,x))
    E.append((t-x,0,x)) a 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 E.append((s-x,1,x)) E.append E append (s-x,1,x) s-x s x 1 x E.append((t-x,0,x)) E.append E append (t-x,0,x) t-x t x 0 x for a in range(Q):
    E.append((int(input()),2,0)) a range(Q) range Q E.append((int(input()),2,0)) E.append E append (int(input()),2,0) int(input()) int input() input 2 0 E.sort() E.sort E sort S=set() S set() set H=[] H [] for time_,type_,x in E:
    if type_==1:
        S.add(x)
        heappush(H,x)
    elif type_==0:
        S.remove(x)
    else:
        while H and H[0] not in S:
            heappop(H)
        print(H[0] if H else -1) time_ type_ x E if type_==1:
        S.add(x)
        heappush(H,x)
    elif type_==0:
        S.remove(x)
    else:
        while H and H[0] not in S:
            heappop(H)
        print(H[0] if H else -1) type_==1 type_ 1 S.add(x) S.add S add x heappush(H,x) heappush H x elif type_==0:
        S.remove(x)
     type_==0 type_ 0 S.remove(x) S.remove S remove x while H and H[0] not in S:
            heappop(H)
         H and H[0] not in S H H[0] not in S H[0] H 0 S heappop(H) heappop H print(H[0] if H else -1) print H[0] if H else -1 H H[0] H 0 -1 input = sys.stdin.readline sys.stdin.readline input t,x=map(int,input().split()) map(int,input().split()) t s,t,x=map(int,input().split()) map(int,input().split()) s N,Q=map(int,input().split()) map(int,input().split()) N S=set() set() S mod=int(10**9+7) int(10**9+7) mod inf=int(10**20) int(10**20) inf H=[] [] H def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A bin_ def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
 

 
#main def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
 

 
#main next_comb Q=map(int,input().split()) map(int,input().split()) Q def comb(n,r):return math.factorial(n)//math.factorial(n-r)//math.factorial(r) def comb(n,r):return math.factorial(n)//math.factorial(n-r)//math.factorial(r) comb class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S) class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S) union_find E=[] [] E x=map(int,input().split()) map(int,input().split()) x
# coding: utf-8
import re
import math
import fractions
import random
from heapq import heappop,heappush
import time
import sys
input = sys.stdin.readline
#import numpy as np
mod=int(10**9+7)
inf=int(10**20)
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def comb(n,r):return math.factorial(n)//math.factorial(n-r)//math.factorial(r)
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
 

 
#main
N,Q=map(int,input().split())
E=[]
for a in range(N):
    s,t,x=map(int,input().split())
    E.append((s-x,1,x))
    E.append((t-x,0,x))

for a in range(Q):
    E.append((int(input()),2,0))
E.sort()
 
S=set()
H=[]
for time_,type_,x in E:
    if type_==1:
        S.add(x)
        heappush(H,x)
    elif type_==0:
        S.remove(x)
    else:
        while H and H[0] not in S:
            heappop(H)
        print(H[0] if H else -1)
