class DualSegmentTree():

    def __init__(self, n, op, e):
        """
        :param n: 配列の要素数
        :param op: 作用素（モノイド＝結合則＋単位元存在）
        :param e:  単位元
        """
        self.n = n
        self.op = op
        self.e = e
        self.size = 1 << (self.n - 1).bit_length()
        self.lazy = [self.e] * (self.size << 1)

    def update(self, l, r, x):
        """
        半開区間 [l, r) の値を x に更新 （ 0-indexed ）　（ O(logN) ）
        """
        l += (self.size - 1)
        r += (self.size - 1)
        self.propagate(l)
        self.propagate(r-1)
        while l < r:
            if r&1 == 0:
                r -= 1              # 半開区間なので先に引いてる
                self.lazy[r] = self.op(x, self.lazy[r])
            if l&1 == 0:
                self.lazy[l] = self.op(x, self.lazy[l])
                l += 1
            l = (l - 1) // 2
            r = (r - 1) // 2

    def propagate(self, i):
        """
        根から葉に伝搬させる。可換モノイドの場合は更新時の伝搬をサボれる。　（ O(logN) ）
        """
        tmp = []
        while i>0:
            i -= 1
            i >>= 1
            tmp.append(i)
        for x in reversed(tmp):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e

    def get(self, i):
        """
        i 番目の値を取得（ 0-indexed ） ( O(logN) )
        """
        i += (self.size - 1)
        self.propagate(i)
        return self.lazy[i]

    def __getitem__(self, i):
        return self.get(i)

    def __iter__(self):
        for x in range(self.size-1):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e
        for a in self.lazy[self.size-1:self.size-1+self.n]:
            yield a

    def __str__(self):
        for x in range(self.size-1):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e
        return str(self.lazy[self.size-1:self.size-1 + self.n])

class ListList:
    """ tupleを一番目の添え字に関してソートする"""
    def __init__(self, max_value_list):
        """
        :param max_value_list: tuple = (i, j, k) を考えた時、  max_value_list = (j_max, k_max)
        """
        self.list_list = []
        self.separation = [0]
        self.max_value_list = list(map(lambda x: x.bit_length(), max_value_list))
        for a in self.max_value_list:
            self.separation.append(self.separation[-1] + a)
        self.separation.reverse()
        self.mask = list(map(lambda x: x-1, self.separation))

    def append(self, array):
        temp = 0
        for x, i in zip(array, self.separation):
            temp += x<<i
        self.list_list.append(temp)

    def sort(self, reverse=False):
        return self.list_list.sort(reverse=reverse)

    def __getitem__(self, item):
        temp = self.list_list[item]
        array = []
        for a in self.max_value_list:
            array = [temp&((1<<a)-1)] + array
            temp>>=a
        array = [temp] + array
        return array

    def __iter__(self):
        for i in range(len(self.list_list)):
            yield self[i]

    def __str__(self):
        text = []
        for a in self:
            text.append("[" + ", ".join(list(map(str, a))) + "]")
        return "[" + ", ".join(text) + "]"

##################################################################################################################
import sys
from bisect import *
input = sys.stdin.readline

N, Q = map(int, input().split())

e = -1
op = lambda x, y: x if x != e else y
st = DualSegmentTree(Q, op, e)

Qu = ListList([10**9,10**9])
for _ in range(N):
    S, T, X = map(int, input().split())
    Qu.append((X, S, T))
Qu.sort(reverse=True)

D = [int(input()) for _ in range(Q)]

for q in Qu:
    X, S, T = q
    L = bisect_left(D,S-X)
    R = bisect_left(D,T-X)
    st.update(L, R, X)
print(*st, sep="\n") class DualSegmentTree():

    def __init__(self, n, op, e):
        """
        :param n: 配列の要素数
        :param op: 作用素（モノイド＝結合則＋単位元存在）
        :param e:  単位元
        """
        self.n = n
        self.op = op
        self.e = e
        self.size = 1 << (self.n - 1).bit_length()
        self.lazy = [self.e] * (self.size << 1)

    def update(self, l, r, x):
        """
        半開区間 [l, r) の値を x に更新 （ 0-indexed ）　（ O(logN) ）
        """
        l += (self.size - 1)
        r += (self.size - 1)
        self.propagate(l)
        self.propagate(r-1)
        while l < r:
            if r&1 == 0:
                r -= 1              # 半開区間なので先に引いてる
                self.lazy[r] = self.op(x, self.lazy[r])
            if l&1 == 0:
                self.lazy[l] = self.op(x, self.lazy[l])
                l += 1
            l = (l - 1) // 2
            r = (r - 1) // 2

    def propagate(self, i):
        """
        根から葉に伝搬させる。可換モノイドの場合は更新時の伝搬をサボれる。　（ O(logN) ）
        """
        tmp = []
        while i>0:
            i -= 1
            i >>= 1
            tmp.append(i)
        for x in reversed(tmp):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e

    def get(self, i):
        """
        i 番目の値を取得（ 0-indexed ） ( O(logN) )
        """
        i += (self.size - 1)
        self.propagate(i)
        return self.lazy[i]

    def __getitem__(self, i):
        return self.get(i)

    def __iter__(self):
        for x in range(self.size-1):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e
        for a in self.lazy[self.size-1:self.size-1+self.n]:
            yield a

    def __str__(self):
        for x in range(self.size-1):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e
        return str(self.lazy[self.size-1:self.size-1 + self.n]) DualSegmentTree def __init__(self, n, op, e):
        """
        :param n: 配列の要素数
        :param op: 作用素（モノイド＝結合則＋単位元存在）
        :param e:  単位元
        """
        self.n = n
        self.op = op
        self.e = e
        self.size = 1 << (self.n - 1).bit_length()
        self.lazy = [self.e] * (self.size << 1)

     __init__ """
        :param n: 配列の要素数
        :param op: 作用素（モノイド＝結合則＋単位元存在）
        :param e:  単位元
        """ self.n = n self.n self n n self.op = op self.op self op op self.e = e self.e self e e self.size = 1 << (self.n - 1).bit_length() self.size self size 1 << (self.n - 1).bit_length() 1 (self.n - 1).bit_length() self.n - 1).bit_length self.n - 1 self.n self n 1 bit_length self.lazy = [self.e] * (self.size << 1) self.lazy self lazy [self.e] * (self.size << 1) [self.e] self.e self e self.size << 1 self.size self size 1 self self n n op op e e def update(self, l, r, x):
        """
        半開区間 [l, r) の値を x に更新 （ 0-indexed ）　（ O(logN) ）
        """
        l += (self.size - 1)
        r += (self.size - 1)
        self.propagate(l)
        self.propagate(r-1)
        while l < r:
            if r&1 == 0:
                r -= 1              # 半開区間なので先に引いてる
                self.lazy[r] = self.op(x, self.lazy[r])
            if l&1 == 0:
                self.lazy[l] = self.op(x, self.lazy[l])
                l += 1
            l = (l - 1) // 2
            r = (r - 1) // 2

     update """
        半開区間 [l, r) の値を x に更新 （ 0-indexed ）　（ O(logN) ）
        """ l += (self.size - 1) l self.size - 1 self.size self size 1 r += (self.size - 1) r self.size - 1 self.size self size 1 self.propagate(l) self.propagate self propagate l self.propagate(r-1) self.propagate self propagate r-1 r 1 while l < r:
            if r&1 == 0:
                r -= 1              # 半開区間なので先に引いてる
                self.lazy[r] = self.op(x, self.lazy[r])
            if l&1 == 0:
                self.lazy[l] = self.op(x, self.lazy[l])
                l += 1
            l = (l - 1) // 2
            r = (r - 1) // 2

     l < r l r if r&1 == 0:
                r -= 1              # 半開区間なので先に引いてる
                self.lazy[r] = self.op(x, self.lazy[r])
             r&1 == 0 r&1 r 1 0 r -= 1 r 1 self.lazy[r] = self.op(x, self.lazy[r]) self.lazy[r] self.lazy self lazy r self.op(x, self.lazy[r]) self.op self op x self.lazy[r] self.lazy self lazy r if l&1 == 0:
                self.lazy[l] = self.op(x, self.lazy[l])
                l += 1
             l&1 == 0 l&1 l 1 0 self.lazy[l] = self.op(x, self.lazy[l]) self.lazy[l] self.lazy self lazy l self.op(x, self.lazy[l]) self.op self op x self.lazy[l] self.lazy self lazy l l += 1 l 1 l = (l - 1) // 2 l (l - 1) // 2 l - 1 l 1 2 r = (r - 1) // 2 r (r - 1) // 2 r - 1 r 1 2 self self l l r r x x def propagate(self, i):
        """
        根から葉に伝搬させる。可換モノイドの場合は更新時の伝搬をサボれる。　（ O(logN) ）
        """
        tmp = []
        while i>0:
            i -= 1
            i >>= 1
            tmp.append(i)
        for x in reversed(tmp):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e

     propagate """
        根から葉に伝搬させる。可換モノイドの場合は更新時の伝搬をサボれる。　（ O(logN) ）
        """ tmp = [] tmp [] while i>0:
            i -= 1
            i >>= 1
            tmp.append(i)
         i>0 i 0 i -= 1 i 1 i >>= 1 i 1 tmp.append(i) tmp.append tmp append i for x in reversed(tmp):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e

     x reversed(tmp) reversed tmp if self.lazy[x] == self.e:
                continue
             self.lazy[x] == self.e self.lazy[x] self.lazy self lazy x self.e self e continue self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1]) self.lazy[2*x+1] self.lazy self lazy 2*x+1 2*x 2 x 1 self.op(self.lazy[x], self.lazy[2*x+1]) self.op self op self.lazy[x] self.lazy self lazy x self.lazy[2*x+1] self.lazy self lazy 2*x+1 2*x 2 x 1 self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2]) self.lazy[2*x+2] self.lazy self lazy 2*x+2 2*x 2 x 2 self.op(self.lazy[x], self.lazy[2*x+2]) self.op self op self.lazy[x] self.lazy self lazy x self.lazy[2*x+2] self.lazy self lazy 2*x+2 2*x 2 x 2 self.lazy[x] = self.e self.lazy[x] self.lazy self lazy x self.e self e self self i i def get(self, i):
        """
        i 番目の値を取得（ 0-indexed ） ( O(logN) )
        """
        i += (self.size - 1)
        self.propagate(i)
        return self.lazy[i]

     get """
        i 番目の値を取得（ 0-indexed ） ( O(logN) )
        """ i += (self.size - 1) i self.size - 1 self.size self size 1 self.propagate(i) self.propagate self propagate i return self.lazy[i] self.lazy[i] self.lazy self lazy i self self i i def __getitem__(self, i):
        return self.get(i)

     __getitem__ return self.get(i) self.get(i) self.get self get i self self i i def __iter__(self):
        for x in range(self.size-1):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e
        for a in self.lazy[self.size-1:self.size-1+self.n]:
            yield a

     __iter__ for x in range(self.size-1):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e
         x range(self.size-1) range self.size-1 self.size self size 1 if self.lazy[x] == self.e:
                continue
             self.lazy[x] == self.e self.lazy[x] self.lazy self lazy x self.e self e continue self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1]) self.lazy[2*x+1] self.lazy self lazy 2*x+1 2*x 2 x 1 self.op(self.lazy[x], self.lazy[2*x+1]) self.op self op self.lazy[x] self.lazy self lazy x self.lazy[2*x+1] self.lazy self lazy 2*x+1 2*x 2 x 1 self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2]) self.lazy[2*x+2] self.lazy self lazy 2*x+2 2*x 2 x 2 self.op(self.lazy[x], self.lazy[2*x+2]) self.op self op self.lazy[x] self.lazy self lazy x self.lazy[2*x+2] self.lazy self lazy 2*x+2 2*x 2 x 2 self.lazy[x] = self.e self.lazy[x] self.lazy self lazy x self.e self e for a in self.lazy[self.size-1:self.size-1+self.n]:
            yield a

     a self.lazy[self.size-1:self.size-1+self.n] self.lazy self lazy self.size-1:self.size-1+self.n self.size-1 self.size self size 1 self.size-1+self.n self.size-1 self.size self size 1 self.n self n yield a a self self def __str__(self):
        for x in range(self.size-1):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e
        return str(self.lazy[self.size-1:self.size-1 + self.n]) __str__ for x in range(self.size-1):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e
         x range(self.size-1) range self.size-1 self.size self size 1 if self.lazy[x] == self.e:
                continue
             self.lazy[x] == self.e self.lazy[x] self.lazy self lazy x self.e self e continue self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1]) self.lazy[2*x+1] self.lazy self lazy 2*x+1 2*x 2 x 1 self.op(self.lazy[x], self.lazy[2*x+1]) self.op self op self.lazy[x] self.lazy self lazy x self.lazy[2*x+1] self.lazy self lazy 2*x+1 2*x 2 x 1 self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2]) self.lazy[2*x+2] self.lazy self lazy 2*x+2 2*x 2 x 2 self.op(self.lazy[x], self.lazy[2*x+2]) self.op self op self.lazy[x] self.lazy self lazy x self.lazy[2*x+2] self.lazy self lazy 2*x+2 2*x 2 x 2 self.lazy[x] = self.e self.lazy[x] self.lazy self lazy x self.e self e return str(self.lazy[self.size-1:self.size-1 + self.n]) str(self.lazy[self.size-1:self.size-1 + self.n]) str self.lazy[self.size-1:self.size-1 + self.n] self.lazy self lazy self.size-1:self.size-1 + self.n self.size-1 self.size self size 1 self.size-1 + self.n self.size-1 self.size self size 1 self.n self n self self class ListList:
    """ tupleを一番目の添え字に関してソートする"""
    def __init__(self, max_value_list):
        """
        :param max_value_list: tuple = (i, j, k) を考えた時、  max_value_list = (j_max, k_max)
        """
        self.list_list = []
        self.separation = [0]
        self.max_value_list = list(map(lambda x: x.bit_length(), max_value_list))
        for a in self.max_value_list:
            self.separation.append(self.separation[-1] + a)
        self.separation.reverse()
        self.mask = list(map(lambda x: x-1, self.separation))

    def append(self, array):
        temp = 0
        for x, i in zip(array, self.separation):
            temp += x<<i
        self.list_list.append(temp)

    def sort(self, reverse=False):
        return self.list_list.sort(reverse=reverse)

    def __getitem__(self, item):
        temp = self.list_list[item]
        array = []
        for a in self.max_value_list:
            array = [temp&((1<<a)-1)] + array
            temp>>=a
        array = [temp] + array
        return array

    def __iter__(self):
        for i in range(len(self.list_list)):
            yield self[i]

    def __str__(self):
        text = []
        for a in self:
            text.append("[" + ", ".join(list(map(str, a))) + "]")
        return "[" + ", ".join(text) + "]"

################################################################################################################## ListList """ tupleを一番目の添え字に関してソートする""" def __init__(self, max_value_list):
        """
        :param max_value_list: tuple = (i, j, k) を考えた時、  max_value_list = (j_max, k_max)
        """
        self.list_list = []
        self.separation = [0]
        self.max_value_list = list(map(lambda x: x.bit_length(), max_value_list))
        for a in self.max_value_list:
            self.separation.append(self.separation[-1] + a)
        self.separation.reverse()
        self.mask = list(map(lambda x: x-1, self.separation))

     __init__ """
        :param max_value_list: tuple = (i, j, k) を考えた時、  max_value_list = (j_max, k_max)
        """ self.list_list = [] self.list_list self list_list [] self.separation = [0] self.separation self separation [0] 0 self.max_value_list = list(map(lambda x: x.bit_length(), max_value_list)) self.max_value_list self max_value_list list(map(lambda x: x.bit_length(), max_value_list)) list map(lambda x: x.bit_length(), max_value_list) map lambda x: x.bit_length() x.bit_length() x.bit_length x bit_length x max_value_list for a in self.max_value_list:
            self.separation.append(self.separation[-1] + a)
         a self.max_value_list self max_value_list self.separation.append(self.separation[-1] + a) self.separation.append self.separation self separation append self.separation[-1] + a self.separation[-1] self.separation self separation -1 a self.separation.reverse() self.separation.reverse self.separation self separation reverse self.mask = list(map(lambda x: x-1, self.separation)) self.mask self mask list(map(lambda x: x-1, self.separation)) list map(lambda x: x-1, self.separation) map lambda x: x-1 x-1 x 1 x self.separation self separation self self max_value_list max_value_list def append(self, array):
        temp = 0
        for x, i in zip(array, self.separation):
            temp += x<<i
        self.list_list.append(temp)

     append temp = 0 temp 0 for x, i in zip(array, self.separation):
            temp += x<<i
         x i zip(array, self.separation) zip array self.separation self separation temp += x<<i temp x<<i x i self.list_list.append(temp) self.list_list.append self.list_list self list_list append temp self self array array def sort(self, reverse=False):
        return self.list_list.sort(reverse=reverse)

     sort return self.list_list.sort(reverse=reverse) self.list_list.sort(reverse=reverse) self.list_list.sort self.list_list self list_list sort reverse=reverse reverse reverse self self reverse=False reverse False def __getitem__(self, item):
        temp = self.list_list[item]
        array = []
        for a in self.max_value_list:
            array = [temp&((1<<a)-1)] + array
            temp>>=a
        array = [temp] + array
        return array

     __getitem__ temp = self.list_list[item] temp self.list_list[item] self.list_list self list_list item array = [] array [] for a in self.max_value_list:
            array = [temp&((1<<a)-1)] + array
            temp>>=a
         a self.max_value_list self max_value_list array = [temp&((1<<a)-1)] + array array [temp&((1<<a)-1)] + array [temp&((1<<a)-1)] temp&((1<<a)-1) temp (1<<a)-1 1<<a 1 a 1 array temp>>=a temp a array = [temp] + array array [temp] + array [temp] temp array return array array self self item item def __iter__(self):
        for i in range(len(self.list_list)):
            yield self[i]

     __iter__ for i in range(len(self.list_list)):
            yield self[i]

     i range(len(self.list_list)) range len(self.list_list) len self.list_list self list_list yield self[i] self[i] self i self self def __str__(self):
        text = []
        for a in self:
            text.append("[" + ", ".join(list(map(str, a))) + "]")
        return "[" + ", ".join(text) + "]"

################################################################################################################## __str__ text = [] text [] for a in self:
            text.append("[" + ", ".join(list(map(str, a))) + "]")
         a self text.append("[" + ", ".join(list(map(str, a))) + "]") text.append text append "[" + ", ".join(list(map(str, a))) + "]" "[" + ", ".join(list(map(str, a))) "[" ", ".join(list(map(str, a))) ", ".join ", " join list(map(str, a)) list map(str, a) map str a "]" return "[" + ", ".join(text) + "]" "[" + ", ".join(text) + "]" "[" + ", ".join(text) "[" ", ".join(text) ", ".join ", " join text "]" self self import sys sys from bisect import * 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 e = -1 e -1 op = lambda x, y: x if x != e else y op lambda x, y: x if x != e else y x if x != e else y x != e x e x y x y st = DualSegmentTree(Q, op, e) st DualSegmentTree(Q, op, e) DualSegmentTree Q op e Qu = ListList([10**9,10**9]) Qu ListList([10**9,10**9]) ListList [10**9,10**9] 10**9 10 9 10**9 10 9 for _ in range(N):
    S, T, X = map(int, input().split())
    Qu.append((X, S, T)) _ 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 Qu.append((X, S, T)) Qu.append Qu append (X, S, T) X S T Qu.sort(reverse=True) Qu.sort Qu sort reverse=True reverse True 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)] for q in Qu:
    X, S, T = q
    L = bisect_left(D,S-X)
    R = bisect_left(D,T-X)
    st.update(L, R, X) q Qu X, S, T = q X q S T L = bisect_left(D,S-X) L bisect_left(D,S-X) bisect_left D S-X S X R = bisect_left(D,T-X) R bisect_left(D,T-X) bisect_left D T-X T X st.update(L, R, X) st.update st update L R X print(*st, sep="\n") print *st st sep="\n" sep "\n" input = sys.stdin.readline sys.stdin.readline input Qu = ListList([10**9,10**9]) ListList([10**9,10**9]) Qu D = [int(input()) for _ in range(Q)] [int(input()) for _ in range(Q)] D T, X = map(int, input().split()) map(int, input().split()) T S, T = q q S R = bisect_left(D,T-X) bisect_left(D,T-X) R X, S, T = q q X S, T, X = map(int, input().split()) map(int, input().split()) S L = bisect_left(D,S-X) bisect_left(D,S-X) L class DualSegmentTree():

    def __init__(self, n, op, e):
        """
        :param n: 配列の要素数
        :param op: 作用素（モノイド＝結合則＋単位元存在）
        :param e:  単位元
        """
        self.n = n
        self.op = op
        self.e = e
        self.size = 1 << (self.n - 1).bit_length()
        self.lazy = [self.e] * (self.size << 1)

    def update(self, l, r, x):
        """
        半開区間 [l, r) の値を x に更新 （ 0-indexed ）　（ O(logN) ）
        """
        l += (self.size - 1)
        r += (self.size - 1)
        self.propagate(l)
        self.propagate(r-1)
        while l < r:
            if r&1 == 0:
                r -= 1              # 半開区間なので先に引いてる
                self.lazy[r] = self.op(x, self.lazy[r])
            if l&1 == 0:
                self.lazy[l] = self.op(x, self.lazy[l])
                l += 1
            l = (l - 1) // 2
            r = (r - 1) // 2

    def propagate(self, i):
        """
        根から葉に伝搬させる。可換モノイドの場合は更新時の伝搬をサボれる。　（ O(logN) ）
        """
        tmp = []
        while i>0:
            i -= 1
            i >>= 1
            tmp.append(i)
        for x in reversed(tmp):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e

    def get(self, i):
        """
        i 番目の値を取得（ 0-indexed ） ( O(logN) )
        """
        i += (self.size - 1)
        self.propagate(i)
        return self.lazy[i]

    def __getitem__(self, i):
        return self.get(i)

    def __iter__(self):
        for x in range(self.size-1):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e
        for a in self.lazy[self.size-1:self.size-1+self.n]:
            yield a

    def __str__(self):
        for x in range(self.size-1):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e
        return str(self.lazy[self.size-1:self.size-1 + self.n]) class DualSegmentTree():

    def __init__(self, n, op, e):
        """
        :param n: 配列の要素数
        :param op: 作用素（モノイド＝結合則＋単位元存在）
        :param e:  単位元
        """
        self.n = n
        self.op = op
        self.e = e
        self.size = 1 << (self.n - 1).bit_length()
        self.lazy = [self.e] * (self.size << 1)

    def update(self, l, r, x):
        """
        半開区間 [l, r) の値を x に更新 （ 0-indexed ）　（ O(logN) ）
        """
        l += (self.size - 1)
        r += (self.size - 1)
        self.propagate(l)
        self.propagate(r-1)
        while l < r:
            if r&1 == 0:
                r -= 1              # 半開区間なので先に引いてる
                self.lazy[r] = self.op(x, self.lazy[r])
            if l&1 == 0:
                self.lazy[l] = self.op(x, self.lazy[l])
                l += 1
            l = (l - 1) // 2
            r = (r - 1) // 2

    def propagate(self, i):
        """
        根から葉に伝搬させる。可換モノイドの場合は更新時の伝搬をサボれる。　（ O(logN) ）
        """
        tmp = []
        while i>0:
            i -= 1
            i >>= 1
            tmp.append(i)
        for x in reversed(tmp):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e

    def get(self, i):
        """
        i 番目の値を取得（ 0-indexed ） ( O(logN) )
        """
        i += (self.size - 1)
        self.propagate(i)
        return self.lazy[i]

    def __getitem__(self, i):
        return self.get(i)

    def __iter__(self):
        for x in range(self.size-1):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e
        for a in self.lazy[self.size-1:self.size-1+self.n]:
            yield a

    def __str__(self):
        for x in range(self.size-1):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e
        return str(self.lazy[self.size-1:self.size-1 + self.n]) DualSegmentTree e = -1 -1 e N, Q = map(int, input().split()) map(int, input().split()) N X = map(int, input().split()) map(int, input().split()) X T = q q T class ListList:
    """ tupleを一番目の添え字に関してソートする"""
    def __init__(self, max_value_list):
        """
        :param max_value_list: tuple = (i, j, k) を考えた時、  max_value_list = (j_max, k_max)
        """
        self.list_list = []
        self.separation = [0]
        self.max_value_list = list(map(lambda x: x.bit_length(), max_value_list))
        for a in self.max_value_list:
            self.separation.append(self.separation[-1] + a)
        self.separation.reverse()
        self.mask = list(map(lambda x: x-1, self.separation))

    def append(self, array):
        temp = 0
        for x, i in zip(array, self.separation):
            temp += x<<i
        self.list_list.append(temp)

    def sort(self, reverse=False):
        return self.list_list.sort(reverse=reverse)

    def __getitem__(self, item):
        temp = self.list_list[item]
        array = []
        for a in self.max_value_list:
            array = [temp&((1<<a)-1)] + array
            temp>>=a
        array = [temp] + array
        return array

    def __iter__(self):
        for i in range(len(self.list_list)):
            yield self[i]

    def __str__(self):
        text = []
        for a in self:
            text.append("[" + ", ".join(list(map(str, a))) + "]")
        return "[" + ", ".join(text) + "]"

################################################################################################################## class ListList:
    """ tupleを一番目の添え字に関してソートする"""
    def __init__(self, max_value_list):
        """
        :param max_value_list: tuple = (i, j, k) を考えた時、  max_value_list = (j_max, k_max)
        """
        self.list_list = []
        self.separation = [0]
        self.max_value_list = list(map(lambda x: x.bit_length(), max_value_list))
        for a in self.max_value_list:
            self.separation.append(self.separation[-1] + a)
        self.separation.reverse()
        self.mask = list(map(lambda x: x-1, self.separation))

    def append(self, array):
        temp = 0
        for x, i in zip(array, self.separation):
            temp += x<<i
        self.list_list.append(temp)

    def sort(self, reverse=False):
        return self.list_list.sort(reverse=reverse)

    def __getitem__(self, item):
        temp = self.list_list[item]
        array = []
        for a in self.max_value_list:
            array = [temp&((1<<a)-1)] + array
            temp>>=a
        array = [temp] + array
        return array

    def __iter__(self):
        for i in range(len(self.list_list)):
            yield self[i]

    def __str__(self):
        text = []
        for a in self:
            text.append("[" + ", ".join(list(map(str, a))) + "]")
        return "[" + ", ".join(text) + "]"

################################################################################################################## ListList Q = map(int, input().split()) map(int, input().split()) Q op = lambda x, y: x if x != e else y lambda x, y: x if x != e else y op st = DualSegmentTree(Q, op, e) DualSegmentTree(Q, op, e) st
class DualSegmentTree():

    def __init__(self, n, op, e):
        """
        :param n: 配列の要素数
        :param op: 作用素（モノイド＝結合則＋単位元存在）
        :param e:  単位元
        """
        self.n = n
        self.op = op
        self.e = e
        self.size = 1 << (self.n - 1).bit_length()
        self.lazy = [self.e] * (self.size << 1)

    def update(self, l, r, x):
        """
        半開区間 [l, r) の値を x に更新 （ 0-indexed ）　（ O(logN) ）
        """
        l += (self.size - 1)
        r += (self.size - 1)
        self.propagate(l)
        self.propagate(r-1)
        while l < r:
            if r&1 == 0:
                r -= 1              # 半開区間なので先に引いてる
                self.lazy[r] = self.op(x, self.lazy[r])
            if l&1 == 0:
                self.lazy[l] = self.op(x, self.lazy[l])
                l += 1
            l = (l - 1) // 2
            r = (r - 1) // 2

    def propagate(self, i):
        """
        根から葉に伝搬させる。可換モノイドの場合は更新時の伝搬をサボれる。　（ O(logN) ）
        """
        tmp = []
        while i>0:
            i -= 1
            i >>= 1
            tmp.append(i)
        for x in reversed(tmp):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e

    def get(self, i):
        """
        i 番目の値を取得（ 0-indexed ） ( O(logN) )
        """
        i += (self.size - 1)
        self.propagate(i)
        return self.lazy[i]

    def __getitem__(self, i):
        return self.get(i)

    def __iter__(self):
        for x in range(self.size-1):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e
        for a in self.lazy[self.size-1:self.size-1+self.n]:
            yield a

    def __str__(self):
        for x in range(self.size-1):
            if self.lazy[x] == self.e:
                continue
            self.lazy[2*x+1] = self.op(self.lazy[x], self.lazy[2*x+1])
            self.lazy[2*x+2] = self.op(self.lazy[x], self.lazy[2*x+2])
            self.lazy[x] = self.e
        return str(self.lazy[self.size-1:self.size-1 + self.n])

class ListList:
    """ tupleを一番目の添え字に関してソートする"""
    def __init__(self, max_value_list):
        """
        :param max_value_list: tuple = (i, j, k) を考えた時、  max_value_list = (j_max, k_max)
        """
        self.list_list = []
        self.separation = [0]
        self.max_value_list = list(map(lambda x: x.bit_length(), max_value_list))
        for a in self.max_value_list:
            self.separation.append(self.separation[-1] + a)
        self.separation.reverse()
        self.mask = list(map(lambda x: x-1, self.separation))

    def append(self, array):
        temp = 0
        for x, i in zip(array, self.separation):
            temp += x<<i
        self.list_list.append(temp)

    def sort(self, reverse=False):
        return self.list_list.sort(reverse=reverse)

    def __getitem__(self, item):
        temp = self.list_list[item]
        array = []
        for a in self.max_value_list:
            array = [temp&((1<<a)-1)] + array
            temp>>=a
        array = [temp] + array
        return array

    def __iter__(self):
        for i in range(len(self.list_list)):
            yield self[i]

    def __str__(self):
        text = []
        for a in self:
            text.append("[" + ", ".join(list(map(str, a))) + "]")
        return "[" + ", ".join(text) + "]"

##################################################################################################################
import sys
from bisect import *
input = sys.stdin.readline

N, Q = map(int, input().split())

e = -1
op = lambda x, y: x if x != e else y
st = DualSegmentTree(Q, op, e)

Qu = ListList([10**9,10**9])
for _ in range(N):
    S, T, X = map(int, input().split())
    Qu.append((X, S, T))
Qu.sort(reverse=True)

D = [int(input()) for _ in range(Q)]

for q in Qu:
    X, S, T = q
    L = bisect_left(D,S-X)
    R = bisect_left(D,T-X)
    st.update(L, R, X)
print(*st, sep="\n")