from bisect import bisect_left
import sys
input = sys.stdin.readline

class SegmentTree():
    def __init__(self,size,func,default):
        self.leaf=2**(size-1).bit_length()
        self.data=[default]*(2*self.leaf-1)
        self.f=func; self.d=default
    def rangeupdate(self,l,r,x):
        l+=self.leaf-1; r+=self.leaf-1
        while l<r:
            if not l&1:
                self.data[l]=self.f(self.data[l],x)
                l+=1
            if not r&1:
                r-=1
                self.data[r]=self.f(self.data[r],x)
            l>>=1; r>>=1
    def getvalue(self,i):
        k=i+self.leaf-1
        ret=self.d
        while k>=0:
            ret=self.f(ret,self.data[k])
            k=(k-1)>>1
        return ret

#最大値            
def segfunc(x,y):
    return max(x,y)

#最小値
def segfunc2(x,y):
    return min(x,y)
#和
def segfunc3(x,y):
    return x | y


def main():
    N, Q = map(int, input().split())
    construction = []
    for _ in range(N):
        S, T, X = map(int, input().split())
        construction.append([S,T,X])

    D = [int(input()) for _ in range(Q)]
    seg = SegmentTree(Q,segfunc2,float('inf'))

    for i in range(N):
        S, T, X = construction[i]
        l = bisect_left(D, S - X)
        r = bisect_left(D, T - X)
        seg.rangeupdate(l, r, X)
    
    for q in range(Q):
        ans = seg.getvalue(q)
        if ans == float('inf'):
            print(-1)
        else:
            print(ans)

if __name__ == "__main__":
    main() from bisect import bisect_left import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline class SegmentTree():
    def __init__(self,size,func,default):
        self.leaf=2**(size-1).bit_length()
        self.data=[default]*(2*self.leaf-1)
        self.f=func; self.d=default
    def rangeupdate(self,l,r,x):
        l+=self.leaf-1; r+=self.leaf-1
        while l<r:
            if not l&1:
                self.data[l]=self.f(self.data[l],x)
                l+=1
            if not r&1:
                r-=1
                self.data[r]=self.f(self.data[r],x)
            l>>=1; r>>=1
    def getvalue(self,i):
        k=i+self.leaf-1
        ret=self.d
        while k>=0:
            ret=self.f(ret,self.data[k])
            k=(k-1)>>1
        return ret

#最大値             SegmentTree def __init__(self,size,func,default):
        self.leaf=2**(size-1).bit_length()
        self.data=[default]*(2*self.leaf-1)
        self.f=func; self.d=default
     __init__ self.leaf=2**(size-1).bit_length() self.leaf self leaf 2**(size-1).bit_length() 2 (size-1).bit_length() size-1).bit_length size-1 size 1 bit_length self.data=[default]*(2*self.leaf-1) self.data self data [default]*(2*self.leaf-1) [default] default 2*self.leaf-1 2*self.leaf 2 self.leaf self leaf 1 self.f=func self.f self f func self.d=default self.d self d default self self size size func func default default def rangeupdate(self,l,r,x):
        l+=self.leaf-1; r+=self.leaf-1
        while l<r:
            if not l&1:
                self.data[l]=self.f(self.data[l],x)
                l+=1
            if not r&1:
                r-=1
                self.data[r]=self.f(self.data[r],x)
            l>>=1; r>>=1
     rangeupdate l+=self.leaf-1 l self.leaf-1 self.leaf self leaf 1 r+=self.leaf-1 r self.leaf-1 self.leaf self leaf 1 while l<r:
            if not l&1:
                self.data[l]=self.f(self.data[l],x)
                l+=1
            if not r&1:
                r-=1
                self.data[r]=self.f(self.data[r],x)
            l>>=1; r>>=1
     l<r l r if not l&1:
                self.data[l]=self.f(self.data[l],x)
                l+=1
             not l&1 l&1 l 1 self.data[l]=self.f(self.data[l],x) self.data[l] self.data self data l self.f(self.data[l],x) self.f self f self.data[l] self.data self data l x l+=1 l 1 if not r&1:
                r-=1
                self.data[r]=self.f(self.data[r],x)
             not r&1 r&1 r 1 r-=1 r 1 self.data[r]=self.f(self.data[r],x) self.data[r] self.data self data r self.f(self.data[r],x) self.f self f self.data[r] self.data self data r x l>>=1 l 1 r>>=1 r 1 self self l l r r x x def getvalue(self,i):
        k=i+self.leaf-1
        ret=self.d
        while k>=0:
            ret=self.f(ret,self.data[k])
            k=(k-1)>>1
        return ret

#最大値             getvalue k=i+self.leaf-1 k i+self.leaf-1 i+self.leaf i self.leaf self leaf 1 ret=self.d ret self.d self d while k>=0:
            ret=self.f(ret,self.data[k])
            k=(k-1)>>1
         k>=0 k 0 ret=self.f(ret,self.data[k]) ret self.f(ret,self.data[k]) self.f self f ret self.data[k] self.data self data k k=(k-1)>>1 k (k-1)>>1 k-1 k 1 1 return ret ret self self i i def segfunc(x,y):
    return max(x,y)

#最小値 segfunc return max(x,y) max(x,y) max x y x x y y def segfunc2(x,y):
    return min(x,y)
#和 segfunc2 return min(x,y) min(x,y) min x y x x y y def segfunc3(x,y):
    return x | y segfunc3 return x | y x | y x y x x y y def main():
    N, Q = map(int, input().split())
    construction = []
    for _ in range(N):
        S, T, X = map(int, input().split())
        construction.append([S,T,X])

    D = [int(input()) for _ in range(Q)]
    seg = SegmentTree(Q,segfunc2,float('inf'))

    for i in range(N):
        S, T, X = construction[i]
        l = bisect_left(D, S - X)
        r = bisect_left(D, T - X)
        seg.rangeupdate(l, r, X)
    
    for q in range(Q):
        ans = seg.getvalue(q)
        if ans == float('inf'):
            print(-1)
        else:
            print(ans) main N, Q = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split Q construction = [] construction [] for _ in range(N):
        S, T, X = map(int, input().split())
        construction.append([S,T,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 construction.append([S,T,X]) construction.append construction append [S,T,X] S T X int(input()) for _ in range(Q) for _ in range(Q) _ range(Q) range Q for _ in range(Q) int(input()) int input() input D = [int(input()) for _ in range(Q)] D [int(input()) for _ in range(Q)] seg = SegmentTree(Q,segfunc2,float('inf')) seg SegmentTree(Q,segfunc2,float('inf')) SegmentTree Q segfunc2 float('inf') float 'inf' for i in range(N):
        S, T, X = construction[i]
        l = bisect_left(D, S - X)
        r = bisect_left(D, T - X)
        seg.rangeupdate(l, r, X)
    
     i range(N) range N S, T, X = construction[i] S construction[i] construction i T X l = bisect_left(D, S - X) l bisect_left(D, S - X) bisect_left D S - X S X r = bisect_left(D, T - X) r bisect_left(D, T - X) bisect_left D T - X T X seg.rangeupdate(l, r, X) seg.rangeupdate seg rangeupdate l r X for q in range(Q):
        ans = seg.getvalue(q)
        if ans == float('inf'):
            print(-1)
        else:
            print(ans) q range(Q) range Q ans = seg.getvalue(q) ans seg.getvalue(q) seg.getvalue seg getvalue q if ans == float('inf'):
            print(-1)
        else:
            print(ans) ans == float('inf') ans float('inf') float 'inf' print(-1) print -1 print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main input = sys.stdin.readline sys.stdin.readline input def segfunc2(x,y):
    return min(x,y)
#和 def segfunc2(x,y):
    return min(x,y)
#和 segfunc2 def segfunc3(x,y):
    return x | y def segfunc3(x,y):
    return x | y segfunc3 def main():
    N, Q = map(int, input().split())
    construction = []
    for _ in range(N):
        S, T, X = map(int, input().split())
        construction.append([S,T,X])

    D = [int(input()) for _ in range(Q)]
    seg = SegmentTree(Q,segfunc2,float('inf'))

    for i in range(N):
        S, T, X = construction[i]
        l = bisect_left(D, S - X)
        r = bisect_left(D, T - X)
        seg.rangeupdate(l, r, X)
    
    for q in range(Q):
        ans = seg.getvalue(q)
        if ans == float('inf'):
            print(-1)
        else:
            print(ans) def main():
    N, Q = map(int, input().split())
    construction = []
    for _ in range(N):
        S, T, X = map(int, input().split())
        construction.append([S,T,X])

    D = [int(input()) for _ in range(Q)]
    seg = SegmentTree(Q,segfunc2,float('inf'))

    for i in range(N):
        S, T, X = construction[i]
        l = bisect_left(D, S - X)
        r = bisect_left(D, T - X)
        seg.rangeupdate(l, r, X)
    
    for q in range(Q):
        ans = seg.getvalue(q)
        if ans == float('inf'):
            print(-1)
        else:
            print(ans) main class SegmentTree():
    def __init__(self,size,func,default):
        self.leaf=2**(size-1).bit_length()
        self.data=[default]*(2*self.leaf-1)
        self.f=func; self.d=default
    def rangeupdate(self,l,r,x):
        l+=self.leaf-1; r+=self.leaf-1
        while l<r:
            if not l&1:
                self.data[l]=self.f(self.data[l],x)
                l+=1
            if not r&1:
                r-=1
                self.data[r]=self.f(self.data[r],x)
            l>>=1; r>>=1
    def getvalue(self,i):
        k=i+self.leaf-1
        ret=self.d
        while k>=0:
            ret=self.f(ret,self.data[k])
            k=(k-1)>>1
        return ret

#最大値             class SegmentTree():
    def __init__(self,size,func,default):
        self.leaf=2**(size-1).bit_length()
        self.data=[default]*(2*self.leaf-1)
        self.f=func; self.d=default
    def rangeupdate(self,l,r,x):
        l+=self.leaf-1; r+=self.leaf-1
        while l<r:
            if not l&1:
                self.data[l]=self.f(self.data[l],x)
                l+=1
            if not r&1:
                r-=1
                self.data[r]=self.f(self.data[r],x)
            l>>=1; r>>=1
    def getvalue(self,i):
        k=i+self.leaf-1
        ret=self.d
        while k>=0:
            ret=self.f(ret,self.data[k])
            k=(k-1)>>1
        return ret

#最大値             SegmentTree def segfunc(x,y):
    return max(x,y)

#最小値 def segfunc(x,y):
    return max(x,y)

#最小値 segfunc
from bisect import bisect_left
import sys
input = sys.stdin.readline

class SegmentTree():
    def __init__(self,size,func,default):
        self.leaf=2**(size-1).bit_length()
        self.data=[default]*(2*self.leaf-1)
        self.f=func; self.d=default
    def rangeupdate(self,l,r,x):
        l+=self.leaf-1; r+=self.leaf-1
        while l<r:
            if not l&1:
                self.data[l]=self.f(self.data[l],x)
                l+=1
            if not r&1:
                r-=1
                self.data[r]=self.f(self.data[r],x)
            l>>=1; r>>=1
    def getvalue(self,i):
        k=i+self.leaf-1
        ret=self.d
        while k>=0:
            ret=self.f(ret,self.data[k])
            k=(k-1)>>1
        return ret

#最大値            
def segfunc(x,y):
    return max(x,y)

#最小値
def segfunc2(x,y):
    return min(x,y)
#和
def segfunc3(x,y):
    return x | y


def main():
    N, Q = map(int, input().split())
    construction = []
    for _ in range(N):
        S, T, X = map(int, input().split())
        construction.append([S,T,X])

    D = [int(input()) for _ in range(Q)]
    seg = SegmentTree(Q,segfunc2,float('inf'))

    for i in range(N):
        S, T, X = construction[i]
        l = bisect_left(D, S - X)
        r = bisect_left(D, T - X)
        seg.rangeupdate(l, r, X)
    
    for q in range(Q):
        ans = seg.getvalue(q)
        if ans == float('inf'):
            print(-1)
        else:
            print(ans)

if __name__ == "__main__":
    main()