class SegmentTreeDual():
    def __init__(self,arr,op=lambda x,y:y if y != -1 else x,ie=-1):
        self.h = (len(arr)-1).bit_length()
        self.n = 2**self.h
        self.ie = ie
        self.op = op
        self.val = [ie for _ in range(self.n)]
        self.laz = [ie for _ in range(2*self.n)]
        for i in range(len(arr)):
            self.val[i] = arr[i]

    def propagate(self,k):
        if self.laz[k] == self.ie: return
        if self.n <= k:
            self.val[k-self.n] = self.op(self.val[k-self.n],self.laz[k])
            self.laz[k] = self.ie
        else:
            self.laz[2*k] = self.op(self.laz[2*k],self.laz[k])
            self.laz[2*k+1] = self.op(self.laz[2*k+1],self.laz[k])
            self.laz[k] = self.ie

    def update(self,left,right,x):
        left += self.n
        right += self.n
        #可換なら不要?
        for i in range(self.h)[::-1]:
            self.propagate(left>>i)
            self.propagate(right>>i)
        #
        while right-left>0:
            if right & 1:
                right -= 1
                self.laz[right] = self.op(self.laz[right],x)
            if left & 1:
                self.laz[left] = self.op(self.laz[left],x)
                left += 1
            left >>= 1
            right >>= 1
    def get(self,index):
        res = self.val[index]
        index += self.n
        while index>0:
            res = self.op(res,self.laz[index])
            index //= 2
        return res


from bisect import bisect_left,bisect_right
import sys
input = sys.stdin.readline
INF = 10**18

N,Q = map(int,input().split())
P = [-INF,INF]
R = []

for i in range(N):
    s,t,x = map(int,input().split())
    R.append((s-x,t-x,x))
    P.append(s-x)
    P.append(t-x)
D = []
for i in range(Q):
    d = int(input())
    D.append(d)
    P.append(d)

R = sorted(R,key=lambda x:x[2],reverse=True)
P = sorted(set(P))
S = dict()
for i in range(len(P)):
    S[P[i]] = i

st = SegmentTreeDual(
                    arr = [-1 for _ in range(len(P))],
                    op = lambda x,y:y if y != -1 else x,
                    ie = -1
                    )
for i in range(N):
    st.update(S[R[i][0]],S[R[i][1]],R[i][2])

ans = []

for i in range(Q):
    ans.append(st.get(S[D[i]]))

print('\n'.join(map(str,ans))) class SegmentTreeDual():
    def __init__(self,arr,op=lambda x,y:y if y != -1 else x,ie=-1):
        self.h = (len(arr)-1).bit_length()
        self.n = 2**self.h
        self.ie = ie
        self.op = op
        self.val = [ie for _ in range(self.n)]
        self.laz = [ie for _ in range(2*self.n)]
        for i in range(len(arr)):
            self.val[i] = arr[i]

    def propagate(self,k):
        if self.laz[k] == self.ie: return
        if self.n <= k:
            self.val[k-self.n] = self.op(self.val[k-self.n],self.laz[k])
            self.laz[k] = self.ie
        else:
            self.laz[2*k] = self.op(self.laz[2*k],self.laz[k])
            self.laz[2*k+1] = self.op(self.laz[2*k+1],self.laz[k])
            self.laz[k] = self.ie

    def update(self,left,right,x):
        left += self.n
        right += self.n
        #可換なら不要?
        for i in range(self.h)[::-1]:
            self.propagate(left>>i)
            self.propagate(right>>i)
        #
        while right-left>0:
            if right & 1:
                right -= 1
                self.laz[right] = self.op(self.laz[right],x)
            if left & 1:
                self.laz[left] = self.op(self.laz[left],x)
                left += 1
            left >>= 1
            right >>= 1
    def get(self,index):
        res = self.val[index]
        index += self.n
        while index>0:
            res = self.op(res,self.laz[index])
            index //= 2
        return res SegmentTreeDual def __init__(self,arr,op=lambda x,y:y if y != -1 else x,ie=-1):
        self.h = (len(arr)-1).bit_length()
        self.n = 2**self.h
        self.ie = ie
        self.op = op
        self.val = [ie for _ in range(self.n)]
        self.laz = [ie for _ in range(2*self.n)]
        for i in range(len(arr)):
            self.val[i] = arr[i]

     __init__ self.h = (len(arr)-1).bit_length() self.h self h (len(arr)-1).bit_length() len(arr)-1).bit_length len(arr)-1 len(arr) len arr 1 bit_length self.n = 2**self.h self.n self n 2**self.h 2 self.h self h self.ie = ie self.ie self ie ie self.op = op self.op self op op ie for _ in range(self.n) for _ in range(self.n) _ range(self.n) range self.n self n for _ in range(self.n) ie self.val = [ie for _ in range(self.n)] self.val self val [ie for _ in range(self.n)] ie for _ in range(2*self.n) for _ in range(2*self.n) _ range(2*self.n) range 2*self.n 2 self.n self n for _ in range(2*self.n) ie self.laz = [ie for _ in range(2*self.n)] self.laz self laz [ie for _ in range(2*self.n)] for i in range(len(arr)):
            self.val[i] = arr[i]

     i range(len(arr)) range len(arr) len arr self.val[i] = arr[i] self.val[i] self.val self val i arr[i] arr i self self arr arr op=lambda x,y:y if y != -1 else x op lambda x,y:y if y != -1 else x y if y != -1 else x y != -1 y -1 y x x y ie=-1 ie -1 def propagate(self,k):
        if self.laz[k] == self.ie: return
        if self.n <= k:
            self.val[k-self.n] = self.op(self.val[k-self.n],self.laz[k])
            self.laz[k] = self.ie
        else:
            self.laz[2*k] = self.op(self.laz[2*k],self.laz[k])
            self.laz[2*k+1] = self.op(self.laz[2*k+1],self.laz[k])
            self.laz[k] = self.ie

     propagate if self.laz[k] == self.ie: return
         self.laz[k] == self.ie self.laz[k] self.laz self laz k self.ie self ie if self.n <= k:
            self.val[k-self.n] = self.op(self.val[k-self.n],self.laz[k])
            self.laz[k] = self.ie
        else:
            self.laz[2*k] = self.op(self.laz[2*k],self.laz[k])
            self.laz[2*k+1] = self.op(self.laz[2*k+1],self.laz[k])
            self.laz[k] = self.ie

     self.n <= k self.n self n k self.val[k-self.n] = self.op(self.val[k-self.n],self.laz[k]) self.val[k-self.n] self.val self val k-self.n k self.n self n self.op(self.val[k-self.n],self.laz[k]) self.op self op self.val[k-self.n] self.val self val k-self.n k self.n self n self.laz[k] self.laz self laz k self.laz[k] = self.ie self.laz[k] self.laz self laz k self.ie self ie self.laz[2*k] = self.op(self.laz[2*k],self.laz[k]) self.laz[2*k] self.laz self laz 2*k 2 k self.op(self.laz[2*k],self.laz[k]) self.op self op self.laz[2*k] self.laz self laz 2*k 2 k self.laz[k] self.laz self laz k self.laz[2*k+1] = self.op(self.laz[2*k+1],self.laz[k]) self.laz[2*k+1] self.laz self laz 2*k+1 2*k 2 k 1 self.op(self.laz[2*k+1],self.laz[k]) self.op self op self.laz[2*k+1] self.laz self laz 2*k+1 2*k 2 k 1 self.laz[k] self.laz self laz k self.laz[k] = self.ie self.laz[k] self.laz self laz k self.ie self ie self self k k def update(self,left,right,x):
        left += self.n
        right += self.n
        #可換なら不要?
        for i in range(self.h)[::-1]:
            self.propagate(left>>i)
            self.propagate(right>>i)
        #
        while right-left>0:
            if right & 1:
                right -= 1
                self.laz[right] = self.op(self.laz[right],x)
            if left & 1:
                self.laz[left] = self.op(self.laz[left],x)
                left += 1
            left >>= 1
            right >>= 1
     update left += self.n left self.n self n right += self.n right self.n self n for i in range(self.h)[::-1]:
            self.propagate(left>>i)
            self.propagate(right>>i)
        #
         i range(self.h)[::-1] (self.h) range self.h self h ::-1 -1 self.propagate(left>>i) self.propagate self propagate left>>i left i self.propagate(right>>i) self.propagate self propagate right>>i right i while right-left>0:
            if right & 1:
                right -= 1
                self.laz[right] = self.op(self.laz[right],x)
            if left & 1:
                self.laz[left] = self.op(self.laz[left],x)
                left += 1
            left >>= 1
            right >>= 1
     right-left>0 right-left right left 0 if right & 1:
                right -= 1
                self.laz[right] = self.op(self.laz[right],x)
             right & 1 right 1 right -= 1 right 1 self.laz[right] = self.op(self.laz[right],x) self.laz[right] self.laz self laz right self.op(self.laz[right],x) self.op self op self.laz[right] self.laz self laz right x if left & 1:
                self.laz[left] = self.op(self.laz[left],x)
                left += 1
             left & 1 left 1 self.laz[left] = self.op(self.laz[left],x) self.laz[left] self.laz self laz left self.op(self.laz[left],x) self.op self op self.laz[left] self.laz self laz left x left += 1 left 1 left >>= 1 left 1 right >>= 1 right 1 self self left left right right x x def get(self,index):
        res = self.val[index]
        index += self.n
        while index>0:
            res = self.op(res,self.laz[index])
            index //= 2
        return res get res = self.val[index] res self.val[index] self.val self val index index += self.n index self.n self n while index>0:
            res = self.op(res,self.laz[index])
            index //= 2
         index>0 index 0 res = self.op(res,self.laz[index]) res self.op(res,self.laz[index]) self.op self op res self.laz[index] self.laz self laz index index //= 2 index 2 return res res self self index index from bisect import bisect_left,bisect_right import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline INF = 10**18 INF 10**18 10 18 N,Q = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split Q P = [-INF,INF] P [-INF,INF] -INF INF INF R = [] R [] for i in range(N):
    s,t,x = map(int,input().split())
    R.append((s-x,t-x,x))
    P.append(s-x)
    P.append(t-x) i 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 R.append((s-x,t-x,x)) R.append R append (s-x,t-x,x) s-x s x t-x t x x P.append(s-x) P.append P append s-x s x P.append(t-x) P.append P append t-x t x D = [] D [] for i in range(Q):
    d = int(input())
    D.append(d)
    P.append(d) i range(Q) range Q d = int(input()) d int(input()) int input() input D.append(d) D.append D append d P.append(d) P.append P append d R = sorted(R,key=lambda x:x[2],reverse=True) R sorted(R,key=lambda x:x[2],reverse=True) sorted R key=lambda x:x[2] key lambda x:x[2] x[2] x 2 x reverse=True reverse True P = sorted(set(P)) P sorted(set(P)) sorted set(P) set P S = dict() S dict() dict for i in range(len(P)):
    S[P[i]] = i i range(len(P)) range len(P) len P S[P[i]] = i S[P[i]] S P[i] P i i -1 for _ in range(len(P)) for _ in range(len(P)) _ range(len(P)) range len(P) len P for _ in range(len(P)) -1 st = SegmentTreeDual(
                    arr = [-1 for _ in range(len(P))],
                    op = lambda x,y:y if y != -1 else x,
                    ie = -1
                    ) st SegmentTreeDual(
                    arr = [-1 for _ in range(len(P))],
                    op = lambda x,y:y if y != -1 else x,
                    ie = -1
                    ) SegmentTreeDual arr = [-1 for _ in range(len(P))] arr [-1 for _ in range(len(P))] op = lambda x,y:y if y != -1 else x op lambda x,y:y if y != -1 else x y if y != -1 else x y != -1 y -1 y x x y ie = -1 ie -1 for i in range(N):
    st.update(S[R[i][0]],S[R[i][1]],R[i][2]) i range(N) range N st.update(S[R[i][0]],S[R[i][1]],R[i][2]) st.update st update S[R[i][0]] S R[i][0] [i] R i 0 S[R[i][1]] S R[i][1] [i] R i 1 R[i][2] [i] R i 2 ans = [] ans [] for i in range(Q):
    ans.append(st.get(S[D[i]])) i range(Q) range Q ans.append(st.get(S[D[i]])) ans.append ans append st.get(S[D[i]]) st.get st get S[D[i]] S D[i] D i print('\n'.join(map(str,ans))) print '\n'.join(map(str,ans)) '\n'.join '\n' join map(str,ans) map str ans N,Q = map(int,input().split()) map(int,input().split()) N x = map(int,input().split()) map(int,input().split()) x ans = [] [] ans input = sys.stdin.readline sys.stdin.readline input R = [] [] R class SegmentTreeDual():
    def __init__(self,arr,op=lambda x,y:y if y != -1 else x,ie=-1):
        self.h = (len(arr)-1).bit_length()
        self.n = 2**self.h
        self.ie = ie
        self.op = op
        self.val = [ie for _ in range(self.n)]
        self.laz = [ie for _ in range(2*self.n)]
        for i in range(len(arr)):
            self.val[i] = arr[i]

    def propagate(self,k):
        if self.laz[k] == self.ie: return
        if self.n <= k:
            self.val[k-self.n] = self.op(self.val[k-self.n],self.laz[k])
            self.laz[k] = self.ie
        else:
            self.laz[2*k] = self.op(self.laz[2*k],self.laz[k])
            self.laz[2*k+1] = self.op(self.laz[2*k+1],self.laz[k])
            self.laz[k] = self.ie

    def update(self,left,right,x):
        left += self.n
        right += self.n
        #可換なら不要?
        for i in range(self.h)[::-1]:
            self.propagate(left>>i)
            self.propagate(right>>i)
        #
        while right-left>0:
            if right & 1:
                right -= 1
                self.laz[right] = self.op(self.laz[right],x)
            if left & 1:
                self.laz[left] = self.op(self.laz[left],x)
                left += 1
            left >>= 1
            right >>= 1
    def get(self,index):
        res = self.val[index]
        index += self.n
        while index>0:
            res = self.op(res,self.laz[index])
            index //= 2
        return res class SegmentTreeDual():
    def __init__(self,arr,op=lambda x,y:y if y != -1 else x,ie=-1):
        self.h = (len(arr)-1).bit_length()
        self.n = 2**self.h
        self.ie = ie
        self.op = op
        self.val = [ie for _ in range(self.n)]
        self.laz = [ie for _ in range(2*self.n)]
        for i in range(len(arr)):
            self.val[i] = arr[i]

    def propagate(self,k):
        if self.laz[k] == self.ie: return
        if self.n <= k:
            self.val[k-self.n] = self.op(self.val[k-self.n],self.laz[k])
            self.laz[k] = self.ie
        else:
            self.laz[2*k] = self.op(self.laz[2*k],self.laz[k])
            self.laz[2*k+1] = self.op(self.laz[2*k+1],self.laz[k])
            self.laz[k] = self.ie

    def update(self,left,right,x):
        left += self.n
        right += self.n
        #可換なら不要?
        for i in range(self.h)[::-1]:
            self.propagate(left>>i)
            self.propagate(right>>i)
        #
        while right-left>0:
            if right & 1:
                right -= 1
                self.laz[right] = self.op(self.laz[right],x)
            if left & 1:
                self.laz[left] = self.op(self.laz[left],x)
                left += 1
            left >>= 1
            right >>= 1
    def get(self,index):
        res = self.val[index]
        index += self.n
        while index>0:
            res = self.op(res,self.laz[index])
            index //= 2
        return res SegmentTreeDual INF = 10**18 10**18 INF s,t,x = map(int,input().split()) map(int,input().split()) s d = int(input()) int(input()) d st = SegmentTreeDual(
                    arr = [-1 for _ in range(len(P))],
                    op = lambda x,y:y if y != -1 else x,
                    ie = -1
                    ) SegmentTreeDual(
                    arr = [-1 for _ in range(len(P))],
                    op = lambda x,y:y if y != -1 else x,
                    ie = -1
                    ) st S = dict() dict() S P = [-INF,INF] [-INF,INF] P P = sorted(set(P)) sorted(set(P)) P t,x = map(int,input().split()) map(int,input().split()) t Q = map(int,input().split()) map(int,input().split()) Q R = sorted(R,key=lambda x:x[2],reverse=True) sorted(R,key=lambda x:x[2],reverse=True) R D = [] [] D
class SegmentTreeDual():
    def __init__(self,arr,op=lambda x,y:y if y != -1 else x,ie=-1):
        self.h = (len(arr)-1).bit_length()
        self.n = 2**self.h
        self.ie = ie
        self.op = op
        self.val = [ie for _ in range(self.n)]
        self.laz = [ie for _ in range(2*self.n)]
        for i in range(len(arr)):
            self.val[i] = arr[i]

    def propagate(self,k):
        if self.laz[k] == self.ie: return
        if self.n <= k:
            self.val[k-self.n] = self.op(self.val[k-self.n],self.laz[k])
            self.laz[k] = self.ie
        else:
            self.laz[2*k] = self.op(self.laz[2*k],self.laz[k])
            self.laz[2*k+1] = self.op(self.laz[2*k+1],self.laz[k])
            self.laz[k] = self.ie

    def update(self,left,right,x):
        left += self.n
        right += self.n
        #可換なら不要?
        for i in range(self.h)[::-1]:
            self.propagate(left>>i)
            self.propagate(right>>i)
        #
        while right-left>0:
            if right & 1:
                right -= 1
                self.laz[right] = self.op(self.laz[right],x)
            if left & 1:
                self.laz[left] = self.op(self.laz[left],x)
                left += 1
            left >>= 1
            right >>= 1
    def get(self,index):
        res = self.val[index]
        index += self.n
        while index>0:
            res = self.op(res,self.laz[index])
            index //= 2
        return res


from bisect import bisect_left,bisect_right
import sys
input = sys.stdin.readline
INF = 10**18

N,Q = map(int,input().split())
P = [-INF,INF]
R = []

for i in range(N):
    s,t,x = map(int,input().split())
    R.append((s-x,t-x,x))
    P.append(s-x)
    P.append(t-x)
D = []
for i in range(Q):
    d = int(input())
    D.append(d)
    P.append(d)

R = sorted(R,key=lambda x:x[2],reverse=True)
P = sorted(set(P))
S = dict()
for i in range(len(P)):
    S[P[i]] = i

st = SegmentTreeDual(
                    arr = [-1 for _ in range(len(P))],
                    op = lambda x,y:y if y != -1 else x,
                    ie = -1
                    )
for i in range(N):
    st.update(S[R[i][0]],S[R[i][1]],R[i][2])

ans = []

for i in range(Q):
    ans.append(st.get(S[D[i]]))

print('\n'.join(map(str,ans)))