from heapq import heappop,heappush
from collections import defaultdict

N,Q = map(int,input().split())
events = []
for _ in range(N):
    s,t,x = map(int,input().split())
    events.append((s-x,1,x))
    events.append((t-x,2,x))

for _ in range(Q):
    d = int(input())
    events.append((d,3,0))

events.sort()

minimumStop = [float("INF")]
stopCount = {float("INF"):1}

for sec,e,x in events:
    if e == 1:
        heappush(minimumStop,x)
        if x not in stopCount:
            stopCount[x] = 0
        stopCount[x] += 1
    if e == 3:
        while stopCount[minimumStop[0]] == 0:
            heappop(minimumStop)
        if minimumStop[0] == float("INF"):
            print(-1)
        else:
            print(minimumStop[0])
    if e == 2:
        stopCount[x] -= 1 from heapq import heappop,heappush from collections import defaultdict N,Q = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split Q events = [] events [] for _ in range(N):
    s,t,x = map(int,input().split())
    events.append((s-x,1,x))
    events.append((t-x,2,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 events.append((s-x,1,x)) events.append events append (s-x,1,x) s-x s x 1 x events.append((t-x,2,x)) events.append events append (t-x,2,x) t-x t x 2 x for _ in range(Q):
    d = int(input())
    events.append((d,3,0)) _ range(Q) range Q d = int(input()) d int(input()) int input() input events.append((d,3,0)) events.append events append (d,3,0) d 3 0 events.sort() events.sort events sort minimumStop = [float("INF")] minimumStop [float("INF")] float("INF") float "INF" stopCount = {float("INF"):1} stopCount {float("INF"):1} float("INF") float("INF") float "INF" 1 for sec,e,x in events:
    if e == 1:
        heappush(minimumStop,x)
        if x not in stopCount:
            stopCount[x] = 0
        stopCount[x] += 1
    if e == 3:
        while stopCount[minimumStop[0]] == 0:
            heappop(minimumStop)
        if minimumStop[0] == float("INF"):
            print(-1)
        else:
            print(minimumStop[0])
    if e == 2:
        stopCount[x] -= 1 sec e x events if e == 1:
        heappush(minimumStop,x)
        if x not in stopCount:
            stopCount[x] = 0
        stopCount[x] += 1
     e == 1 e 1 heappush(minimumStop,x) heappush minimumStop x if x not in stopCount:
            stopCount[x] = 0
         x not in stopCount x stopCount stopCount[x] = 0 stopCount[x] stopCount x 0 stopCount[x] += 1 stopCount[x] stopCount x 1 if e == 3:
        while stopCount[minimumStop[0]] == 0:
            heappop(minimumStop)
        if minimumStop[0] == float("INF"):
            print(-1)
        else:
            print(minimumStop[0])
     e == 3 e 3 while stopCount[minimumStop[0]] == 0:
            heappop(minimumStop)
         stopCount[minimumStop[0]] == 0 stopCount[minimumStop[0]] stopCount minimumStop[0] minimumStop 0 0 heappop(minimumStop) heappop minimumStop if minimumStop[0] == float("INF"):
            print(-1)
        else:
            print(minimumStop[0])
     minimumStop[0] == float("INF") minimumStop[0] minimumStop 0 float("INF") float "INF" print(-1) print -1 print(minimumStop[0]) print minimumStop[0] minimumStop 0 if e == 2:
        stopCount[x] -= 1 e == 2 e 2 stopCount[x] -= 1 stopCount[x] stopCount x 1 s,t,x = map(int,input().split()) map(int,input().split()) s t,x = map(int,input().split()) map(int,input().split()) t Q = map(int,input().split()) map(int,input().split()) Q d = int(input()) int(input()) d events = [] [] events N,Q = map(int,input().split()) map(int,input().split()) N stopCount = {float("INF"):1} {float("INF"):1} stopCount minimumStop = [float("INF")] [float("INF")] minimumStop x = map(int,input().split()) map(int,input().split()) x
from heapq import heappop,heappush
from collections import defaultdict

N,Q = map(int,input().split())
events = []
for _ in range(N):
    s,t,x = map(int,input().split())
    events.append((s-x,1,x))
    events.append((t-x,2,x))

for _ in range(Q):
    d = int(input())
    events.append((d,3,0))

events.sort()

minimumStop = [float("INF")]
stopCount = {float("INF"):1}

for sec,e,x in events:
    if e == 1:
        heappush(minimumStop,x)
        if x not in stopCount:
            stopCount[x] = 0
        stopCount[x] += 1
    if e == 3:
        while stopCount[minimumStop[0]] == 0:
            heappop(minimumStop)
        if minimumStop[0] == float("INF"):
            print(-1)
        else:
            print(minimumStop[0])
    if e == 2:
        stopCount[x] -= 1
