n,q=map(int,input().split())
stx=[list(map(int,input().split())) for _ in range(n)]
d=[int(input()) for _ in range(q)]
inf=float('inf')

import heapq
class pqheap:
  def __init__(self,key=None):
    self.p = list()
    self.q = list()

  def insert(self,x):
    heapq.heappush(self.p, x)
    return

  def erase(self,x):
    heapq.heappush(self.q, x)
    return

  def minimum(self):
    while self.q and self.p[0] == self.q[0]:
      heapq.heappop(self.p)
      heapq.heappop(self.q)
    return self.p[0] if len(self.p)>0 else -1
memopush={}
memopop={}
from bisect import bisect_left,bisect_right
for s,t,x in stx:
  l,r=max(0,s-x),max(0,t-x)
  # 出発時刻が[l,r)の人の進む距離がxで抑えられる
  if l in memopush:
    memopush[l].append(x)
  else:
    memopush[l]=[x]
  if r in memopop:
    memopop[r].append(x)
  else:
    memopop[r]=[x]
keys=list(set(memopush.keys()).union(set(memopop.keys())))
keys.sort()
pq=pqheap()
dct=[[-1,-1]]
for k in keys:
  if k in memopush:
    for v in memopush[k]:
      pq.insert(v)
  if k in memopop:
    for v in memopop[k]:
      pq.erase(v)
  dct.append([k,pq.minimum()])
i=0
for x in d:
  while i+1<len(dct) and dct[i+1][0]<=x:
    i+=1
  if i>=len(dct):
    print(-1)
  else:
    print(dct[i][1])

#print(dct) n,q=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split q list(map(int,input().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split stx=[list(map(int,input().split())) for _ in range(n)] stx [list(map(int,input().split())) for _ in range(n)] int(input()) for _ in range(q) for _ in range(q) _ range(q) range q for _ in range(q) int(input()) int input() input d=[int(input()) for _ in range(q)] d [int(input()) for _ in range(q)] inf=float('inf') inf float('inf') float 'inf' import heapq heapq class pqheap:
  def __init__(self,key=None):
    self.p = list()
    self.q = list()

  def insert(self,x):
    heapq.heappush(self.p, x)
    return

  def erase(self,x):
    heapq.heappush(self.q, x)
    return

  def minimum(self):
    while self.q and self.p[0] == self.q[0]:
      heapq.heappop(self.p)
      heapq.heappop(self.q)
    return self.p[0] if len(self.p)>0 else -1 pqheap def __init__(self,key=None):
    self.p = list()
    self.q = list()

   __init__ self.p = list() self.p self p list() list self.q = list() self.q self q list() list self self key=None key None def insert(self,x):
    heapq.heappush(self.p, x)
    return

   insert heapq.heappush(self.p, x) heapq.heappush heapq heappush self.p self p x return self self x x def erase(self,x):
    heapq.heappush(self.q, x)
    return

   erase heapq.heappush(self.q, x) heapq.heappush heapq heappush self.q self q x return self self x x def minimum(self):
    while self.q and self.p[0] == self.q[0]:
      heapq.heappop(self.p)
      heapq.heappop(self.q)
    return self.p[0] if len(self.p)>0 else -1 minimum while self.q and self.p[0] == self.q[0]:
      heapq.heappop(self.p)
      heapq.heappop(self.q)
     self.q and self.p[0] == self.q[0] self.q self q self.p[0] == self.q[0] self.p[0] self.p self p 0 self.q[0] self.q self q 0 heapq.heappop(self.p) heapq.heappop heapq heappop self.p self p heapq.heappop(self.q) heapq.heappop heapq heappop self.q self q return self.p[0] if len(self.p)>0 else -1 self.p[0] if len(self.p)>0 else -1 len(self.p)>0 len(self.p) len self.p self p 0 self.p[0] self.p self p 0 -1 self self memopush={} memopush {} memopop={} memopop {} from bisect import bisect_left,bisect_right for s,t,x in stx:
  l,r=max(0,s-x),max(0,t-x)
  # 出発時刻が[l,r)の人の進む距離がxで抑えられる
  if l in memopush:
    memopush[l].append(x)
  else:
    memopush[l]=[x]
  if r in memopop:
    memopop[r].append(x)
  else:
    memopop[r]=[x] s t x stx l,r=max(0,s-x),max(0,t-x) l max(0,s-x) max 0 s-x s x r max(0,t-x) max 0 t-x t x if l in memopush:
    memopush[l].append(x)
  else:
    memopush[l]=[x]
   l in memopush l memopush memopush[l].append(x) [l].append [l] memopush l append x memopush[l]=[x] memopush[l] memopush l [x] x if r in memopop:
    memopop[r].append(x)
  else:
    memopop[r]=[x] r in memopop r memopop memopop[r].append(x) [r].append [r] memopop r append x memopop[r]=[x] memopop[r] memopop r [x] x keys=list(set(memopush.keys()).union(set(memopop.keys()))) keys list(set(memopush.keys()).union(set(memopop.keys()))) list set(memopush.keys()).union(set(memopop.keys())) (memopush.keys()).union (memopush.keys()) set memopush.keys() memopush.keys memopush keys union set(memopop.keys()) set memopop.keys() memopop.keys memopop keys keys.sort() keys.sort keys sort pq=pqheap() pq pqheap() pqheap dct=[[-1,-1]] dct [[-1,-1]] [-1,-1] -1 -1 for k in keys:
  if k in memopush:
    for v in memopush[k]:
      pq.insert(v)
  if k in memopop:
    for v in memopop[k]:
      pq.erase(v)
  dct.append([k,pq.minimum()]) k keys if k in memopush:
    for v in memopush[k]:
      pq.insert(v)
   k in memopush k memopush for v in memopush[k]:
      pq.insert(v)
   v memopush[k] memopush k pq.insert(v) pq.insert pq insert v if k in memopop:
    for v in memopop[k]:
      pq.erase(v)
   k in memopop k memopop for v in memopop[k]:
      pq.erase(v)
   v memopop[k] memopop k pq.erase(v) pq.erase pq erase v dct.append([k,pq.minimum()]) dct.append dct append [k,pq.minimum()] k pq.minimum() pq.minimum pq minimum i=0 i 0 for x in d:
  while i+1<len(dct) and dct[i+1][0]<=x:
    i+=1
  if i>=len(dct):
    print(-1)
  else:
    print(dct[i][1])

#print(dct) x d while i+1<len(dct) and dct[i+1][0]<=x:
    i+=1
   i+1<len(dct) and dct[i+1][0]<=x i+1<len(dct) i+1 i 1 len(dct) len dct dct[i+1][0]<=x dct[i+1][0] [i+1] dct i+1 i 1 0 x i+=1 i 1 if i>=len(dct):
    print(-1)
  else:
    print(dct[i][1])

#print(dct) i>=len(dct) i len(dct) len dct print(-1) print -1 print(dct[i][1]) print dct[i][1] [i] dct i 1 i=0 0 i pq=pqheap() pqheap() pq i+=1 1 i inf=float('inf') float('inf') inf stx=[list(map(int,input().split())) for _ in range(n)] [list(map(int,input().split())) for _ in range(n)] stx l,r=max(0,s-x),max(0,t-x) max(0,s-x) l dct=[[-1,-1]] [[-1,-1]] dct d=[int(input()) for _ in range(q)] [int(input()) for _ in range(q)] d r=max(0,s-x),max(0,t-x) max(0,t-x) r keys=list(set(memopush.keys()).union(set(memopop.keys()))) list(set(memopush.keys()).union(set(memopop.keys()))) keys n,q=map(int,input().split()) map(int,input().split()) n q=map(int,input().split()) map(int,input().split()) q class pqheap:
  def __init__(self,key=None):
    self.p = list()
    self.q = list()

  def insert(self,x):
    heapq.heappush(self.p, x)
    return

  def erase(self,x):
    heapq.heappush(self.q, x)
    return

  def minimum(self):
    while self.q and self.p[0] == self.q[0]:
      heapq.heappop(self.p)
      heapq.heappop(self.q)
    return self.p[0] if len(self.p)>0 else -1 class pqheap:
  def __init__(self,key=None):
    self.p = list()
    self.q = list()

  def insert(self,x):
    heapq.heappush(self.p, x)
    return

  def erase(self,x):
    heapq.heappush(self.q, x)
    return

  def minimum(self):
    while self.q and self.p[0] == self.q[0]:
      heapq.heappop(self.p)
      heapq.heappop(self.q)
    return self.p[0] if len(self.p)>0 else -1 pqheap memopop={} {} memopop memopush={} {} memopush
n,q=map(int,input().split())
stx=[list(map(int,input().split())) for _ in range(n)]
d=[int(input()) for _ in range(q)]
inf=float('inf')

import heapq
class pqheap:
  def __init__(self,key=None):
    self.p = list()
    self.q = list()

  def insert(self,x):
    heapq.heappush(self.p, x)
    return

  def erase(self,x):
    heapq.heappush(self.q, x)
    return

  def minimum(self):
    while self.q and self.p[0] == self.q[0]:
      heapq.heappop(self.p)
      heapq.heappop(self.q)
    return self.p[0] if len(self.p)>0 else -1
memopush={}
memopop={}
from bisect import bisect_left,bisect_right
for s,t,x in stx:
  l,r=max(0,s-x),max(0,t-x)
  # 出発時刻が[l,r)の人の進む距離がxで抑えられる
  if l in memopush:
    memopush[l].append(x)
  else:
    memopush[l]=[x]
  if r in memopop:
    memopop[r].append(x)
  else:
    memopop[r]=[x]
keys=list(set(memopush.keys()).union(set(memopop.keys())))
keys.sort()
pq=pqheap()
dct=[[-1,-1]]
for k in keys:
  if k in memopush:
    for v in memopush[k]:
      pq.insert(v)
  if k in memopop:
    for v in memopop[k]:
      pq.erase(v)
  dct.append([k,pq.minimum()])
i=0
for x in d:
  while i+1<len(dct) and dct[i+1][0]<=x:
    i+=1
  if i>=len(dct):
    print(-1)
  else:
    print(dct[i][1])

#print(dct)