#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
# inf = float('inf') ;mod = 10**9+7
# mans = inf ;ans = 0 ;count = 0 ;pro = 1
from heapq import heappush,heappop

n,q=map(int,input().split())
STX=[tuple(map(int,input().split())) for i in range(n)]
D=[int(input()) for i in range(q)]
event=[]
for si,ti,xi in STX:
  event.append((si-xi,0,xi))
  event.append((ti-xi,-1,xi))
for di in D:
  event.append((di,1,di))
event.sort()
hq=[]; S=set()
for time, query, number in event:
  if query == 0:
    heappush(hq,number)
    S.add(number)
  elif query == -1:
    S.remove(number)
  else:
    while hq and hq[0] not in S:
      heappop(hq)
    if not hq:
      print(-1)
    else:
      print(hq[0])

 import sys, math, itertools, collections, bisect sys math itertools collections bisect input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') input lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') sys.stdin.buffer.readline().rstrip().decode('utf-8') sys.stdin.buffer.readline().rstrip().decode sys.stdin.buffer.readline().rstrip() sys.stdin.buffer.readline().rstrip sys.stdin.buffer.readline() sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline rstrip decode 'utf-8' from heapq import heappush,heappop n,q=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split q tuple(map(int,input().split())) for i in range(n) for i in range(n) i range(n) range n for i in range(n) tuple(map(int,input().split())) tuple map(int,input().split()) map int input().split() ().split () input split STX=[tuple(map(int,input().split())) for i in range(n)] STX [tuple(map(int,input().split())) for i in range(n)] int(input()) for i in range(q) for i in range(q) i range(q) range q for i in range(q) int(input()) int input() input D=[int(input()) for i in range(q)] D [int(input()) for i in range(q)] event=[] event [] for si,ti,xi in STX:
  event.append((si-xi,0,xi))
  event.append((ti-xi,-1,xi)) si ti xi STX event.append((si-xi,0,xi)) event.append event append (si-xi,0,xi) si-xi si xi 0 xi event.append((ti-xi,-1,xi)) event.append event append (ti-xi,-1,xi) ti-xi ti xi -1 xi for di in D:
  event.append((di,1,di)) di D event.append((di,1,di)) event.append event append (di,1,di) di 1 di event.sort() event.sort event sort hq=[] hq [] S=set() S set() set for time, query, number in event:
  if query == 0:
    heappush(hq,number)
    S.add(number)
  elif query == -1:
    S.remove(number)
  else:
    while hq and hq[0] not in S:
      heappop(hq)
    if not hq:
      print(-1)
    else:
      print(hq[0]) time query number event if query == 0:
    heappush(hq,number)
    S.add(number)
  elif query == -1:
    S.remove(number)
  else:
    while hq and hq[0] not in S:
      heappop(hq)
    if not hq:
      print(-1)
    else:
      print(hq[0]) query == 0 query 0 heappush(hq,number) heappush hq number S.add(number) S.add S add number elif query == -1:
    S.remove(number)
   query == -1 query -1 S.remove(number) S.remove S remove number while hq and hq[0] not in S:
      heappop(hq)
     hq and hq[0] not in S hq hq[0] not in S hq[0] hq 0 S heappop(hq) heappop hq if not hq:
      print(-1)
    else:
      print(hq[0]) not hq hq print(-1) print -1 print(hq[0]) print hq[0] hq 0 STX=[tuple(map(int,input().split())) for i in range(n)] [tuple(map(int,input().split())) for i in range(n)] STX event=[] [] event S=set() set() S input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') input q=map(int,input().split()) map(int,input().split()) q hq=[] [] hq n,q=map(int,input().split()) map(int,input().split()) n D=[int(input()) for i in range(q)] [int(input()) for i in range(q)] D
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
# inf = float('inf') ;mod = 10**9+7
# mans = inf ;ans = 0 ;count = 0 ;pro = 1
from heapq import heappush,heappop

n,q=map(int,input().split())
STX=[tuple(map(int,input().split())) for i in range(n)]
D=[int(input()) for i in range(q)]
event=[]
for si,ti,xi in STX:
  event.append((si-xi,0,xi))
  event.append((ti-xi,-1,xi))
for di in D:
  event.append((di,1,di))
event.sort()
hq=[]; S=set()
for time, query, number in event:
  if query == 0:
    heappush(hq,number)
    S.add(number)
  elif query == -1:
    S.remove(number)
  else:
    while hq and hq[0] not in S:
      heappop(hq)
    if not hq:
      print(-1)
    else:
      print(hq[0])


