# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############
N,Q = IL()
raw_data = ILL(N)
q = [-INF]+ILs(Q)+[INF]

raw_data.sort(lambda x:x[2],reverse = True)
dic = [q[i] for i in range(Q)]

class RUQ:
  def __init__(self, N, default = None):
    self.N0 = 2**(N-1).bit_length()
    self.data = [None]*(2*self.N0)
    self.INF = (-1, default)
  # 区間[l, r+1)の値をvに書き換える
  # vは(t, value)という値にする (新しい値ほどtは大きくなる)
  def update(self, l, r, v):
    L = l + self.N0; R = r + self.N0
    while L < R:
      if R & 1:
        R -= 1
        self.data[R-1] = v
      if L & 1:
        self.data[L-1] = v
        L += 1
      L >>= 1; R >>= 1
  # a_iの現在の値を取得
  def _query(self, k):
    k += self.N0-1
    s = self.INF
    while k >= 0:
      if self.data[k]:
        s = max(s, self.data[k])
      k = (k - 1) // 2
    return s
  # これを呼び出す
  def query(self, k):
      return self._query(k)[1]

ST = RUQ(Q+2,-1)
tt = 0
for s,t,x in raw_data:
  l = bisect.bisect_left(q,s-x)
  r = bisect.bisect_left(q,t-x)
  ST.update(l,r,(tt,x))
  tt += 1
  
for i in range(Q):
  print(ST.query(i+1)) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline import math math import bisect bisect from collections import defaultdict from collections import deque from functools import lru_cache MOD = 10**9+7 MOD 10**9+7 10**9 10 9 7 INF = float('inf') INF float('inf') float 'inf' def I(): return int(input().strip()) I def S(): return input().strip() S def IL(): return list(map(int,input().split())) IL def SL(): return list(map(str,input().split())) SL def ILs(n): return list(int(input()) for _ in range(n)) ILs n n def SLs(n): return list(input().strip() for _ in range(n)) SLs n n 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 def ILL(n): return [list(map(int, input().split())) for _ in range(n)] ILL n n list(map(str, input().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(map(str, input().split())) list map(str, input().split()) map str input().split() ().split () input split def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT###### SLL n n def P(arg): print(arg); return P arg arg def Y(): print("Yes"); return Y def N(): print("No"); return N def E(): exit() E def PE(arg): print(arg); exit() PE arg arg def YE(): print("Yes"); exit() YE def NE(): print("No"); exit()

#####Shorten##### NE def DD(arg): return defaultdict(arg)


#####Inverse##### DD arg arg def inv(n): return pow(n, MOD-2, MOD)

######Combination###### inv n n kaijo_memo = [] kaijo_memo [] def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n] kaijo if(len(kaijo_memo) > n):
    return kaijo_memo[n]
   len(kaijo_memo) > n len(kaijo_memo) len kaijo_memo n return kaijo_memo[n] kaijo_memo[n] kaijo_memo n if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
   len(kaijo_memo) == 0 len(kaijo_memo) len kaijo_memo 0 kaijo_memo.append(1) kaijo_memo.append kaijo_memo append 1 while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
   len(kaijo_memo) <= n len(kaijo_memo) len kaijo_memo n kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD) kaijo_memo.append kaijo_memo append kaijo_memo[-1] * len(kaijo_memo) % MOD kaijo_memo[-1] * len(kaijo_memo) kaijo_memo[-1] kaijo_memo -1 len(kaijo_memo) len kaijo_memo MOD return kaijo_memo[n] kaijo_memo[n] kaijo_memo n n n gyaku_kaijo_memo = [] gyaku_kaijo_memo [] def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n] gyaku_kaijo if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
   len(gyaku_kaijo_memo) > n len(gyaku_kaijo_memo) len gyaku_kaijo_memo n return gyaku_kaijo_memo[n] gyaku_kaijo_memo[n] gyaku_kaijo_memo n if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
   len(gyaku_kaijo_memo) == 0 len(gyaku_kaijo_memo) len gyaku_kaijo_memo 0 gyaku_kaijo_memo.append(1) gyaku_kaijo_memo.append gyaku_kaijo_memo append 1 while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
   len(gyaku_kaijo_memo) <= n len(gyaku_kaijo_memo) len gyaku_kaijo_memo n gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD) gyaku_kaijo_memo.append gyaku_kaijo_memo append gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) gyaku_kaijo_memo[-1] gyaku_kaijo_memo -1 pow(len(gyaku_kaijo_memo),MOD-2,MOD) pow len(gyaku_kaijo_memo) len gyaku_kaijo_memo MOD-2 MOD 2 MOD MOD return gyaku_kaijo_memo[n] gyaku_kaijo_memo[n] gyaku_kaijo_memo n n n def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization###### nCr if(n == r):
    return 1
   n == r n r return 1 1 if(n < r or r < 0):
    return 0
   n < r or r < 0 n < r n r r < 0 r 0 return 0 0 ret = 1 ret 1 ret = ret * kaijo(n) % MOD ret ret * kaijo(n) % MOD ret * kaijo(n) ret kaijo(n) kaijo n MOD ret = ret * gyaku_kaijo(r) % MOD ret ret * gyaku_kaijo(r) % MOD ret * gyaku_kaijo(r) ret gyaku_kaijo(r) gyaku_kaijo r MOD ret = ret * gyaku_kaijo(n-r) % MOD ret ret * gyaku_kaijo(n-r) % MOD ret * gyaku_kaijo(n-r) ret gyaku_kaijo(n-r) gyaku_kaijo n-r n r MOD return ret ret n n r r def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors###### factorization arr = [] arr [] temp = n temp n for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
   i range(2, int(-(-n**0.5//1))+1) range 2 int(-(-n**0.5//1))+1 int(-(-n**0.5//1)) int -(-n**0.5//1) -n**0.5//1 -n**0.5 n**0.5 n 0.5 1 1 if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
   temp%i==0 temp%i temp i 0 cnt=0 cnt 0 while temp%i==0: 
        cnt+=1 
        temp //= i
       temp%i==0 temp%i temp i 0 cnt+=1 cnt 1 temp //= i temp i arr.append([i, cnt]) arr.append arr append [i, cnt] i cnt if temp!=1:
    arr.append([temp, 1])
   temp!=1 temp 1 arr.append([temp, 1]) arr.append arr append [temp, 1] temp 1 if arr==[]:
    arr.append([n, 1])
   arr==[] arr [] arr.append([n, 1]) arr.append arr append [n, 1] n 1 return arr arr n n def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####GCD##### make_divisors divisors = [] divisors [] for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
   i range(1, int(n**0.5)+1) range 1 int(n**0.5)+1 int(n**0.5) int n**0.5 n 0.5 1 if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
   n % i == 0 n % i n i 0 divisors.append(i) divisors.append divisors append i if i != n // i: 
        divisors.append(n//i)
   i != n // i i n // i n i divisors.append(n//i) divisors.append divisors append n//i n i return divisors divisors n n def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM##### gcd while b:
        a, b = b, a % b
     b a, b = b, a % b a b b a % b a b return a a a a b b def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount##### lcm return a * b // gcd (a, b) a * b // gcd (a, b) a * b a b gcd (a, b) gcd a b a a b b def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase##### count_bit count = 0 count 0 while n:
    n &= n -1
    count += 1
   n n &= n -1 n n -1 n 1 count += 1 count 1 return count count n n def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n] base_10_to_n if X//n:
    return base_10_to_n(X//n, n)+[X%n]
   X//n X n return base_10_to_n(X//n, n)+[X%n] base_10_to_n(X//n, n)+[X%n] base_10_to_n(X//n, n) base_10_to_n X//n X n n [X%n] X%n X n return [X%n] [X%n] X%n X n X X n n def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))

#####IntLog##### base_n_to_10 return sum(int(str(X)[-i])*n**i for i in range(len(str(X)))) sum(int(str(X)[-i])*n**i for i in range(len(str(X)))) sum int(str(X)[-i])*n**i int(str(X)[-i]) int str(X)[-i] (X) str X -i i n**i n i X X n n def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
############# int_log count = 0 count 0 while n>=a:
    n //= a
    count += 1
   n>=a n a n //= a n a count += 1 count 1 return count count n n a a N,Q = IL() N IL() IL Q raw_data = ILL(N) raw_data ILL(N) ILL N q = [-INF]+ILs(Q)+[INF] q [-INF]+ILs(Q)+[INF] [-INF]+ILs(Q) [-INF] -INF INF ILs(Q) ILs Q [INF] INF raw_data.sort(lambda x:x[2],reverse = True) raw_data.sort raw_data sort lambda x:x[2] x[2] x 2 x reverse = True reverse True q[i] for i in range(Q) for i in range(Q) i range(Q) range Q for i in range(Q) q[i] q i dic = [q[i] for i in range(Q)] dic [q[i] for i in range(Q)] class RUQ:
  def __init__(self, N, default = None):
    self.N0 = 2**(N-1).bit_length()
    self.data = [None]*(2*self.N0)
    self.INF = (-1, default)
  # 区間[l, r+1)の値をvに書き換える
  # vは(t, value)という値にする (新しい値ほどtは大きくなる)
  def update(self, l, r, v):
    L = l + self.N0; R = r + self.N0
    while L < R:
      if R & 1:
        R -= 1
        self.data[R-1] = v
      if L & 1:
        self.data[L-1] = v
        L += 1
      L >>= 1; R >>= 1
  # a_iの現在の値を取得
  def _query(self, k):
    k += self.N0-1
    s = self.INF
    while k >= 0:
      if self.data[k]:
        s = max(s, self.data[k])
      k = (k - 1) // 2
    return s
  # これを呼び出す
  def query(self, k):
      return self._query(k)[1] RUQ def __init__(self, N, default = None):
    self.N0 = 2**(N-1).bit_length()
    self.data = [None]*(2*self.N0)
    self.INF = (-1, default)
  # 区間[l, r+1)の値をvに書き換える
  # vは(t, value)という値にする (新しい値ほどtは大きくなる)
   __init__ self.N0 = 2**(N-1).bit_length() self.N0 self N0 2**(N-1).bit_length() 2 (N-1).bit_length() N-1).bit_length N-1 N 1 bit_length self.data = [None]*(2*self.N0) self.data self data [None]*(2*self.N0) [None] None 2*self.N0 2 self.N0 self N0 self.INF = (-1, default) self.INF self INF (-1, default) -1 default self self N N default = None default None def update(self, l, r, v):
    L = l + self.N0; R = r + self.N0
    while L < R:
      if R & 1:
        R -= 1
        self.data[R-1] = v
      if L & 1:
        self.data[L-1] = v
        L += 1
      L >>= 1; R >>= 1
  # a_iの現在の値を取得
   update L = l + self.N0 L l + self.N0 l self.N0 self N0 R = r + self.N0 R r + self.N0 r self.N0 self N0 while L < R:
      if R & 1:
        R -= 1
        self.data[R-1] = v
      if L & 1:
        self.data[L-1] = v
        L += 1
      L >>= 1; R >>= 1
  # a_iの現在の値を取得
   L < R L R if R & 1:
        R -= 1
        self.data[R-1] = v
       R & 1 R 1 R -= 1 R 1 self.data[R-1] = v self.data[R-1] self.data self data R-1 R 1 v if L & 1:
        self.data[L-1] = v
        L += 1
       L & 1 L 1 self.data[L-1] = v self.data[L-1] self.data self data L-1 L 1 v L += 1 L 1 L >>= 1 L 1 R >>= 1 R 1 self self l l r r v v def _query(self, k):
    k += self.N0-1
    s = self.INF
    while k >= 0:
      if self.data[k]:
        s = max(s, self.data[k])
      k = (k - 1) // 2
    return s
  # これを呼び出す
   _query k += self.N0-1 k self.N0-1 self.N0 self N0 1 s = self.INF s self.INF self INF while k >= 0:
      if self.data[k]:
        s = max(s, self.data[k])
      k = (k - 1) // 2
     k >= 0 k 0 if self.data[k]:
        s = max(s, self.data[k])
       self.data[k] self.data self data k s = max(s, self.data[k]) s max(s, self.data[k]) max s self.data[k] self.data self data k k = (k - 1) // 2 k (k - 1) // 2 k - 1 k 1 2 return s s self self k k def query(self, k):
      return self._query(k)[1] query return self._query(k)[1] self._query(k)[1] self._query(k) self._query self _query k 1 self self k k ST = RUQ(Q+2,-1) ST RUQ(Q+2,-1) RUQ Q+2 Q 2 -1 tt = 0 tt 0 for s,t,x in raw_data:
  l = bisect.bisect_left(q,s-x)
  r = bisect.bisect_left(q,t-x)
  ST.update(l,r,(tt,x))
  tt += 1
   s t x raw_data l = bisect.bisect_left(q,s-x) l bisect.bisect_left(q,s-x) bisect.bisect_left bisect bisect_left q s-x s x r = bisect.bisect_left(q,t-x) r bisect.bisect_left(q,t-x) bisect.bisect_left bisect bisect_left q t-x t x ST.update(l,r,(tt,x)) ST.update ST update l r (tt,x) tt x tt += 1 tt 1 for i in range(Q):
  print(ST.query(i+1)) i range(Q) range Q print(ST.query(i+1)) print ST.query(i+1) ST.query ST query i+1 i 1 def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####GCD##### def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####GCD##### make_divisors def ILL(n): return [list(map(int, input().split())) for _ in range(n)] def ILL(n): return [list(map(int, input().split())) for _ in range(n)] ILL def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM##### def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM##### gcd dic = [q[i] for i in range(Q)] [q[i] for i in range(Q)] dic def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT###### def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT###### SLL def N(): print("No"); return def N(): print("No"); return N def E(): exit() def E(): exit() E def Y(): print("Yes"); return def Y(): print("Yes"); return Y r = bisect.bisect_left(q,t-x) bisect.bisect_left(q,t-x) r class RUQ:
  def __init__(self, N, default = None):
    self.N0 = 2**(N-1).bit_length()
    self.data = [None]*(2*self.N0)
    self.INF = (-1, default)
  # 区間[l, r+1)の値をvに書き換える
  # vは(t, value)という値にする (新しい値ほどtは大きくなる)
  def update(self, l, r, v):
    L = l + self.N0; R = r + self.N0
    while L < R:
      if R & 1:
        R -= 1
        self.data[R-1] = v
      if L & 1:
        self.data[L-1] = v
        L += 1
      L >>= 1; R >>= 1
  # a_iの現在の値を取得
  def _query(self, k):
    k += self.N0-1
    s = self.INF
    while k >= 0:
      if self.data[k]:
        s = max(s, self.data[k])
      k = (k - 1) // 2
    return s
  # これを呼び出す
  def query(self, k):
      return self._query(k)[1] class RUQ:
  def __init__(self, N, default = None):
    self.N0 = 2**(N-1).bit_length()
    self.data = [None]*(2*self.N0)
    self.INF = (-1, default)
  # 区間[l, r+1)の値をvに書き換える
  # vは(t, value)という値にする (新しい値ほどtは大きくなる)
  def update(self, l, r, v):
    L = l + self.N0; R = r + self.N0
    while L < R:
      if R & 1:
        R -= 1
        self.data[R-1] = v
      if L & 1:
        self.data[L-1] = v
        L += 1
      L >>= 1; R >>= 1
  # a_iの現在の値を取得
  def _query(self, k):
    k += self.N0-1
    s = self.INF
    while k >= 0:
      if self.data[k]:
        s = max(s, self.data[k])
      k = (k - 1) // 2
    return s
  # これを呼び出す
  def query(self, k):
      return self._query(k)[1] RUQ l = bisect.bisect_left(q,s-x) bisect.bisect_left(q,s-x) l def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))

#####IntLog##### def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))

#####IntLog##### base_n_to_10 Q = IL() IL() Q N,Q = IL() IL() N def I(): return int(input().strip()) def I(): return int(input().strip()) I def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase##### def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase##### count_bit def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n] def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n] base_10_to_n def inv(n): return pow(n, MOD-2, MOD)

######Combination###### def inv(n): return pow(n, MOD-2, MOD)

######Combination###### inv raw_data = ILL(N) ILL(N) raw_data gyaku_kaijo_memo = [] [] gyaku_kaijo_memo def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n] def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n] kaijo def S(): return input().strip() def S(): return input().strip() S def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n] def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n] gyaku_kaijo def IL(): return list(map(int,input().split())) def IL(): return list(map(int,input().split())) IL def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors###### def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors###### factorization def YE(): print("Yes"); exit() def YE(): print("Yes"); exit() YE def DD(arg): return defaultdict(arg)


#####Inverse##### def DD(arg): return defaultdict(arg)


#####Inverse##### DD def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization###### def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization###### nCr input = sys.stdin.readline sys.stdin.readline input tt = 0 0 tt def PE(arg): print(arg); exit() def PE(arg): print(arg); exit() PE INF = float('inf') float('inf') INF def P(arg): print(arg); return def P(arg): print(arg); return P q = [-INF]+ILs(Q)+[INF] [-INF]+ILs(Q)+[INF] q ST = RUQ(Q+2,-1) RUQ(Q+2,-1) ST tt += 1 1 tt def SLs(n): return list(input().strip() for _ in range(n)) def SLs(n): return list(input().strip() for _ in range(n)) SLs MOD = 10**9+7 10**9+7 MOD def NE(): print("No"); exit()

#####Shorten##### def NE(): print("No"); exit()

#####Shorten##### NE def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount##### def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount##### lcm def ILs(n): return list(int(input()) for _ in range(n)) def ILs(n): return list(int(input()) for _ in range(n)) ILs def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
############# def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
############# int_log kaijo_memo = [] [] kaijo_memo def SL(): return list(map(str,input().split())) def SL(): return list(map(str,input().split())) SL
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############
N,Q = IL()
raw_data = ILL(N)
q = [-INF]+ILs(Q)+[INF]

raw_data.sort(lambda x:x[2],reverse = True)
dic = [q[i] for i in range(Q)]

class RUQ:
  def __init__(self, N, default = None):
    self.N0 = 2**(N-1).bit_length()
    self.data = [None]*(2*self.N0)
    self.INF = (-1, default)
  # 区間[l, r+1)の値をvに書き換える
  # vは(t, value)という値にする (新しい値ほどtは大きくなる)
  def update(self, l, r, v):
    L = l + self.N0; R = r + self.N0
    while L < R:
      if R & 1:
        R -= 1
        self.data[R-1] = v
      if L & 1:
        self.data[L-1] = v
        L += 1
      L >>= 1; R >>= 1
  # a_iの現在の値を取得
  def _query(self, k):
    k += self.N0-1
    s = self.INF
    while k >= 0:
      if self.data[k]:
        s = max(s, self.data[k])
      k = (k - 1) // 2
    return s
  # これを呼び出す
  def query(self, k):
      return self._query(k)[1]

ST = RUQ(Q+2,-1)
tt = 0
for s,t,x in raw_data:
  l = bisect.bisect_left(q,s-x)
  r = bisect.bisect_left(q,t-x)
  ST.update(l,r,(tt,x))
  tt += 1
  
for i in range(Q):
  print(ST.query(i+1))
