### BUGGY CODE ###

import sys

sys.setrecursionlimit(500000)
def input():
    return sys.stdin.readline()[:-1]

def main():
    N,Q = list(map(int,input().split()))

    road = []
    x_list = []

    for i in range(N):
        s,t,x = list(map(int,input().split()))
        road.append([0,s-x,x])
        road.append([1,t-x,x])
        x_list.append(x)

    for i in range(Q):
        road.append([2,int(input()),i])

    x_list.sort()

    from collections import defaultdict
    dd1 = defaultdict(int)
    dd2 = defaultdict(int)

    count = -1
    prev = -1
    for i in range(N):
        if x_list[i]!=prev:
            prev=x_list[i]
            count+=1
        dd1[x_list[i]] = count
        dd2[count] = x_list[i]

    class BIT:
                
        def __init__(self, L):
            self.N = len(L)
            self.bit = [0]*self.N
            for i,l in enumerate(L):
                self.add(i,l)

        def add(self, a, w):
            x = a + 1
            for i in range(1000):
                self.bit[x-1] += w
                x += x & -x
                if x > self.N:
                    break

        def sum(self, a):
            x = a+1
            ret = 0
            for i in range(1000):
                ret += self.bit[x-1]
                x -= x & -x
                if x <= 0:
                    break        
            return ret

    bit = BIT([0]*(count+1))

    def get_zero():
        B = bit.sum(count)
        C = bit.sum(0)
        if B==0:
            return count+1
        elif C>=1:
            return 0
        else:
            l = 0
            r = count
            while r-l>1:
                if bit.sum((l+r)//2) >= 1:
                    r = (l+r)//2
                else:
                    l = (l+r)//2
            return r

    road.sort(key = lambda x:x[0])
    road.sort(key = lambda x:x[1])
    #print(road)
    ans = [0]*Q

    for obj in road:
        if obj[0]==0:
            bit.add(dd1[obj[2]], 1)
        elif obj[0]==1:
            bit.add(dd1[obj[2]], -1)
        else:
            #print(*[bit.sum(i) for i in range(3)])
            r = get_zero()
            if r==count+1:
                ans[obj[2]] = -1
            else:
                ans[obj[2]] = dd2[r]

    print(*ans,sep="\n")




if __name__ == '__main__':
    main()



### FIXED CODE ###

import sys

sys.setrecursionlimit(500000)
def input():
    return sys.stdin.readline()[:-1]

def main():
    N,Q = list(map(int,input().split()))

    road = []
    x_list = []

    for i in range(N):
        s,t,x = list(map(int,input().split()))
        road.append([0,s-x,x])
        road.append([1,t-x,x])

    for i in range(Q):
        road.append([2,int(input()),i])

    from collections import defaultdict

    counter = defaultdict(int)
    counter[10**27] = 1
    ans = [0]*Q

    road.sort(key=lambda x:x[0])
    road.sort(key=lambda x:x[1])

    q = [10**27]

    from heapq import heappop,heappush

    for id,_,x in road:
        if id==0:
            heappush(q,x)
            counter[x]+=1
        elif id==1:
            counter[x]-=1
        else:
            while counter[q[0]]==0:
                heappop(q)
            #print(q)
            if q[0]<10**27:
                ans[x] = q[0]
            else:
                ans[x] = -1
    print("\n".join(map(str,ans)))

if __name__ == '__main__':
    main()