#13:12
n,q = map(int,input().split())
import heapq
import sys
input = sys.stdin.readline
event = []
for _ in range(n):
  s,t,x = map(int,input().split())
  heapq.heappush(event,(s-x,t-x,x))
t = 0
now = []
for _ in range(q):
  d = int(input())
  if event:
    while event[0][0] <= d:
      tmp = heapq.heappop(event)
      heapq.heappush(now,(tmp[2],tmp[1]))
      if not event:
        break
  if now:
    while now[0][1] <= d:
      heapq.heappop(now)
      if not now:
        print(-1)
        break
    else:
      print(now[0][0])
  else:
    print(-1) n,q = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split q import heapq heapq import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline event = [] event [] for _ in range(n):
  s,t,x = map(int,input().split())
  heapq.heappush(event,(s-x,t-x,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 heapq.heappush(event,(s-x,t-x,x)) heapq.heappush heapq heappush event (s-x,t-x,x) s-x s x t-x t x x t = 0 t 0 now = [] now [] for _ in range(q):
  d = int(input())
  if event:
    while event[0][0] <= d:
      tmp = heapq.heappop(event)
      heapq.heappush(now,(tmp[2],tmp[1]))
      if not event:
        break
  if now:
    while now[0][1] <= d:
      heapq.heappop(now)
      if not now:
        print(-1)
        break
    else:
      print(now[0][0])
  else:
    print(-1) _ range(q) range q d = int(input()) d int(input()) int input() input if event:
    while event[0][0] <= d:
      tmp = heapq.heappop(event)
      heapq.heappush(now,(tmp[2],tmp[1]))
      if not event:
        break
   event while event[0][0] <= d:
      tmp = heapq.heappop(event)
      heapq.heappush(now,(tmp[2],tmp[1]))
      if not event:
        break
   event[0][0] <= d event[0][0] [0] event 0 0 d tmp = heapq.heappop(event) tmp heapq.heappop(event) heapq.heappop heapq heappop event heapq.heappush(now,(tmp[2],tmp[1])) heapq.heappush heapq heappush now (tmp[2],tmp[1]) tmp[2] tmp 2 tmp[1] tmp 1 if not event:
        break
   not event event break if now:
    while now[0][1] <= d:
      heapq.heappop(now)
      if not now:
        print(-1)
        break
    else:
      print(now[0][0])
  else:
    print(-1) now while now[0][1] <= d:
      heapq.heappop(now)
      if not now:
        print(-1)
        break
    else:
      print(now[0][0])
   now[0][1] <= d now[0][1] [0] now 0 1 d heapq.heappop(now) heapq.heappop heapq heappop now if not now:
        print(-1)
        break
     not now now print(-1) print -1 break print(now[0][0]) print now[0][0] [0] now 0 0 print(-1) print -1 s,t,x = map(int,input().split()) map(int,input().split()) s n,q = map(int,input().split()) map(int,input().split()) n q = map(int,input().split()) map(int,input().split()) q t,x = map(int,input().split()) map(int,input().split()) t x = map(int,input().split()) map(int,input().split()) x now = [] [] now t = 0 0 t input = sys.stdin.readline sys.stdin.readline input tmp = heapq.heappop(event) heapq.heappop(event) tmp event = [] [] event d = int(input()) int(input()) d
#13:12
n,q = map(int,input().split())
import heapq
import sys
input = sys.stdin.readline
event = []
for _ in range(n):
  s,t,x = map(int,input().split())
  heapq.heappush(event,(s-x,t-x,x))
t = 0
now = []
for _ in range(q):
  d = int(input())
  if event:
    while event[0][0] <= d:
      tmp = heapq.heappop(event)
      heapq.heappush(now,(tmp[2],tmp[1]))
      if not event:
        break
  if now:
    while now[0][1] <= d:
      heapq.heappop(now)
      if not now:
        print(-1)
        break
    else:
      print(now[0][0])
  else:
    print(-1)