from bisect import*
b=bisect_left
n,q,*t=map(int,open(0).read().split())
p=t[-q:]
*a,=o=[-1]*q
for x,t,s in sorted(zip(*[iter(t[~q::-1])]*3)):
 l,r=b(p,s-x),b(p,t-x)
 while l<r:
  if~o[l]:l=o[l]
  else:a[l],o[l]=x,r;l+=1
print(*a) from bisect import* b=bisect_left b bisect_left n,q,*t=map(int,open(0).read().split()) n map(int,open(0).read().split()) map int open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split q *t t p=t[-q:] p t[-q:] t -q: -q q *a,=o=[-1]*q *a a [-1]*q [-1] -1 q =o=[-1]*q o [-1]*q for x,t,s in sorted(zip(*[iter(t[~q::-1])]*3)):
 l,r=b(p,s-x),b(p,t-x)
 while l<r:
  if~o[l]:l=o[l]
  else:a[l],o[l]=x,r;l+=1 x t s sorted(zip(*[iter(t[~q::-1])]*3)) sorted zip(*[iter(t[~q::-1])]*3) zip *[iter(t[~q::-1])]*3 [iter(t[~q::-1])]*3 [iter(t[~q::-1])] iter(t[~q::-1]) iter t[~q::-1] t ~q::-1 ~q q -1 3 l,r=b(p,s-x),b(p,t-x) l b(p,s-x) b p s-x s x r b(p,t-x) b p t-x t x while l<r:
  if~o[l]:l=o[l]
  else:a[l],o[l]=x,r;l+=1 l<r l r if~o[l]:l=o[l]
  else:a[l],o[l]=x,r;l+=1 ~o[l] o[l] o l print(*a) print *a a b=bisect_left bisect_left b p=t[-q:] t[-q:] p n,q,*t=map(int,open(0).read().split()) map(int,open(0).read().split()) n l,r=b(p,s-x),b(p,t-x) b(p,s-x) l o=[-1]*q [-1]*q o r=b(p,s-x),b(p,t-x) b(p,t-x) r q,*t=map(int,open(0).read().split()) map(int,open(0).read().split()) q
from bisect import*
b=bisect_left
n,q,*t=map(int,open(0).read().split())
p=t[-q:]
*a,=o=[-1]*q
for x,t,s in sorted(zip(*[iter(t[~q::-1])]*3)):
 l,r=b(p,s-x),b(p,t-x)
 while l<r:
  if~o[l]:l=o[l]
  else:a[l],o[l]=x,r;l+=1
print(*a)