import heapq
import sys
input=sys.stdin.readline
N,Q=map(int,input().split())

event_list=[]
for i in range(N):
  S,T,X=map(int,input().split())
  event_list.append((S-X-0.5,1,X))
  event_list.append((T-X-0.5,-1,X))
  
dlist=[]
for i in range(Q):
  D=int(input())
  event_list.append((D,0,X))  
  dlist.append(D)
event_list.sort()
#print(event_list)

answer_dic={}
stop_set=set()
min_set=float("inf")
for t,f,x in event_list:
  if f==1:
    stop_set.add(x)
    if x<min_set:
      min_set=x
  elif f==-1:
    stop_set.remove(x)
    if x==min_set:
      if len(stop_set)>0:
        min_set=min(stop_set)
      else:
        min_set=float("inf")
  else:
    if len(stop_set)>0:
      answer_dic[t]=min_set
    else:
      answer_dic[t]=-1
#print(answer_dic)

for d in dlist:
  print(answer_dic[d]) import heapq heapq import sys sys input=sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline N,Q=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split Q event_list=[] event_list [] for i in range(N):
  S,T,X=map(int,input().split())
  event_list.append((S-X-0.5,1,X))
  event_list.append((T-X-0.5,-1,X))
   i 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 event_list.append((S-X-0.5,1,X)) event_list.append event_list append (S-X-0.5,1,X) S-X-0.5 S-X S X 0.5 1 X event_list.append((T-X-0.5,-1,X)) event_list.append event_list append (T-X-0.5,-1,X) T-X-0.5 T-X T X 0.5 -1 X dlist=[] dlist [] for i in range(Q):
  D=int(input())
  event_list.append((D,0,X))  
  dlist.append(D) i range(Q) range Q D=int(input()) D int(input()) int input() input event_list.append((D,0,X)) event_list.append event_list append (D,0,X) D 0 X dlist.append(D) dlist.append dlist append D event_list.sort() event_list.sort event_list sort answer_dic={} answer_dic {} stop_set=set() stop_set set() set min_set=float("inf") min_set float("inf") float "inf" for t,f,x in event_list:
  if f==1:
    stop_set.add(x)
    if x<min_set:
      min_set=x
  elif f==-1:
    stop_set.remove(x)
    if x==min_set:
      if len(stop_set)>0:
        min_set=min(stop_set)
      else:
        min_set=float("inf")
  else:
    if len(stop_set)>0:
      answer_dic[t]=min_set
    else:
      answer_dic[t]=-1
#print(answer_dic) t f x event_list if f==1:
    stop_set.add(x)
    if x<min_set:
      min_set=x
  elif f==-1:
    stop_set.remove(x)
    if x==min_set:
      if len(stop_set)>0:
        min_set=min(stop_set)
      else:
        min_set=float("inf")
  else:
    if len(stop_set)>0:
      answer_dic[t]=min_set
    else:
      answer_dic[t]=-1
#print(answer_dic) f==1 f 1 stop_set.add(x) stop_set.add stop_set add x if x<min_set:
      min_set=x
   x<min_set x min_set min_set=x min_set x elif f==-1:
    stop_set.remove(x)
    if x==min_set:
      if len(stop_set)>0:
        min_set=min(stop_set)
      else:
        min_set=float("inf")
   f==-1 f -1 stop_set.remove(x) stop_set.remove stop_set remove x if x==min_set:
      if len(stop_set)>0:
        min_set=min(stop_set)
      else:
        min_set=float("inf")
   x==min_set x min_set if len(stop_set)>0:
        min_set=min(stop_set)
      else:
        min_set=float("inf")
   len(stop_set)>0 len(stop_set) len stop_set 0 min_set=min(stop_set) min_set min(stop_set) min stop_set min_set=float("inf") min_set float("inf") float "inf" if len(stop_set)>0:
      answer_dic[t]=min_set
    else:
      answer_dic[t]=-1
#print(answer_dic) len(stop_set)>0 len(stop_set) len stop_set 0 answer_dic[t]=min_set answer_dic[t] answer_dic t min_set answer_dic[t]=-1 answer_dic[t] answer_dic t -1 for d in dlist:
  print(answer_dic[d]) d dlist print(answer_dic[d]) print answer_dic[d] answer_dic d input=sys.stdin.readline sys.stdin.readline input dlist=[] [] dlist min_set=x x min_set min_set=float("inf") float("inf") min_set 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 answer_dic={} {} answer_dic min_set=float("inf") float("inf") min_set D=int(input()) int(input()) D event_list=[] [] event_list S,T,X=map(int,input().split()) map(int,input().split()) S stop_set=set() set() stop_set N,Q=map(int,input().split()) map(int,input().split()) N min_set=min(stop_set) min(stop_set) min_set
import heapq
import sys
input=sys.stdin.readline
N,Q=map(int,input().split())

event_list=[]
for i in range(N):
  S,T,X=map(int,input().split())
  event_list.append((S-X-0.5,1,X))
  event_list.append((T-X-0.5,-1,X))
  
dlist=[]
for i in range(Q):
  D=int(input())
  event_list.append((D,0,X))  
  dlist.append(D)
event_list.sort()
#print(event_list)

answer_dic={}
stop_set=set()
min_set=float("inf")
for t,f,x in event_list:
  if f==1:
    stop_set.add(x)
    if x<min_set:
      min_set=x
  elif f==-1:
    stop_set.remove(x)
    if x==min_set:
      if len(stop_set)>0:
        min_set=min(stop_set)
      else:
        min_set=float("inf")
  else:
    if len(stop_set)>0:
      answer_dic[t]=min_set
    else:
      answer_dic[t]=-1
#print(answer_dic)

for d in dlist:
  print(answer_dic[d])