import sys
sys.setrecursionlimit(10**7)

readline = sys.stdin.buffer.readline
def readstr():return readline().rstrip().decode()
def readstrs():return list(readline().decode().split())
def readint():return int(readline())
def readints():return list(map(int,readline().split()))
def printrows(x):print('\n'.join(map(str,x)))
def printline(x):print(' '.join(map(str,x)))

import heapq

n,q = readints()

a = []
for i in range(n):
    s,t,x = readints()
    a.append((s-x,0,x))
    a.append((t-x,1,x))
for i in range(q):
    d = readint()
    a.append((d,2,0))
a.sort()

ans = []

stop = []
deleted = []

for t,j,x in a:
    if j==0:
        heapq.heappush(stop,x)
    elif j==1:
        heapq.heappush(deleted,x)
    else:
        while deleted and stop[0] == deleted[0]:
            heapq.heappop(stop)
            heapq.heappop(deleted)
        if stop:
            ans.append(stop[0])
        else:
            ans.append(-1)

printrows(ans) import sys sys sys.setrecursionlimit(10**7) sys.setrecursionlimit sys setrecursionlimit 10**7 10 7 readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline def readstr():return readline().rstrip().decode() readstr def readstrs():return list(readline().decode().split()) readstrs def readint():return int(readline()) readint def readints():return list(map(int,readline().split())) readints def printrows(x):print('\n'.join(map(str,x))) printrows x x def printline(x):print(' '.join(map(str,x))) printline x x import heapq heapq n,q = readints() n readints() readints q a = [] a [] for i in range(n):
    s,t,x = readints()
    a.append((s-x,0,x))
    a.append((t-x,1,x)) i range(n) range n s,t,x = readints() s readints() readints t x a.append((s-x,0,x)) a.append a append (s-x,0,x) s-x s x 0 x a.append((t-x,1,x)) a.append a append (t-x,1,x) t-x t x 1 x for i in range(q):
    d = readint()
    a.append((d,2,0)) i range(q) range q d = readint() d readint() readint a.append((d,2,0)) a.append a append (d,2,0) d 2 0 a.sort() a.sort a sort ans = [] ans [] stop = [] stop [] deleted = [] deleted [] for t,j,x in a:
    if j==0:
        heapq.heappush(stop,x)
    elif j==1:
        heapq.heappush(deleted,x)
    else:
        while deleted and stop[0] == deleted[0]:
            heapq.heappop(stop)
            heapq.heappop(deleted)
        if stop:
            ans.append(stop[0])
        else:
            ans.append(-1) t j x a if j==0:
        heapq.heappush(stop,x)
    elif j==1:
        heapq.heappush(deleted,x)
    else:
        while deleted and stop[0] == deleted[0]:
            heapq.heappop(stop)
            heapq.heappop(deleted)
        if stop:
            ans.append(stop[0])
        else:
            ans.append(-1) j==0 j 0 heapq.heappush(stop,x) heapq.heappush heapq heappush stop x elif j==1:
        heapq.heappush(deleted,x)
     j==1 j 1 heapq.heappush(deleted,x) heapq.heappush heapq heappush deleted x while deleted and stop[0] == deleted[0]:
            heapq.heappop(stop)
            heapq.heappop(deleted)
         deleted and stop[0] == deleted[0] deleted stop[0] == deleted[0] stop[0] stop 0 deleted[0] deleted 0 heapq.heappop(stop) heapq.heappop heapq heappop stop heapq.heappop(deleted) heapq.heappop heapq heappop deleted if stop:
            ans.append(stop[0])
        else:
            ans.append(-1) stop ans.append(stop[0]) ans.append ans append stop[0] stop 0 ans.append(-1) ans.append ans append -1 printrows(ans) printrows ans s,t,x = readints() readints() s readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline def readstrs():return list(readline().decode().split()) def readstrs():return list(readline().decode().split()) readstrs def readstr():return readline().rstrip().decode() def readstr():return readline().rstrip().decode() readstr a = [] [] a d = readint() readint() d def readint():return int(readline()) def readint():return int(readline()) readint t,x = readints() readints() t x = readints() readints() x ans = [] [] ans n,q = readints() readints() n def printrows(x):print('\n'.join(map(str,x))) def printrows(x):print('\n'.join(map(str,x))) printrows q = readints() readints() q def printline(x):print(' '.join(map(str,x))) def printline(x):print(' '.join(map(str,x))) printline deleted = [] [] deleted def readints():return list(map(int,readline().split())) def readints():return list(map(int,readline().split())) readints stop = [] [] stop
import sys
sys.setrecursionlimit(10**7)

readline = sys.stdin.buffer.readline
def readstr():return readline().rstrip().decode()
def readstrs():return list(readline().decode().split())
def readint():return int(readline())
def readints():return list(map(int,readline().split()))
def printrows(x):print('\n'.join(map(str,x)))
def printline(x):print(' '.join(map(str,x)))

import heapq

n,q = readints()

a = []
for i in range(n):
    s,t,x = readints()
    a.append((s-x,0,x))
    a.append((t-x,1,x))
for i in range(q):
    d = readint()
    a.append((d,2,0))
a.sort()

ans = []

stop = []
deleted = []

for t,j,x in a:
    if j==0:
        heapq.heappush(stop,x)
    elif j==1:
        heapq.heappush(deleted,x)
    else:
        while deleted and stop[0] == deleted[0]:
            heapq.heappop(stop)
            heapq.heappop(deleted)
        if stop:
            ans.append(stop[0])
        else:
            ans.append(-1)

printrows(ans)
