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] = x
            if l&1 == 0:
                self.lazy[l] = x
                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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            self.lazy[x] = self.e
        return str(self.lazy[self.size-1:self.size-1 + self.n])

##################################################################################################################
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 = [list(map(int, input().split())) for _ in range(N)]
Qu.sort(key=lambda x:x[2], reverse=True)

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

for q in Qu:
    S, T, X = 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] = x
            if l&1 == 0:
                self.lazy[l] = x
                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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            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] = x
            if l&1 == 0:
                self.lazy[l] = x
                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] = x
            if l&1 == 0:
                self.lazy[l] = x
                l += 1
            l = (l - 1) // 2
            r = (r - 1) // 2

     l < r l r if r&1 == 0:
                r -= 1              # 半開区間なので先に引いてる
                self.lazy[r] = x
             r&1 == 0 r&1 r 1 0 r -= 1 r 1 self.lazy[r] = x self.lazy[r] self.lazy self lazy r x if l&1 == 0:
                self.lazy[l] = x
                l += 1
             l&1 == 0 l&1 l 1 0 self.lazy[l] = x self.lazy[l] self.lazy self lazy l x 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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            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.lazy[x] self.lazy[2*x+1] self.lazy self lazy 2*x+1 2*x 2 x 1 self.lazy[x] self.lazy self lazy x self.lazy[2*x+2] = self.lazy[x] self.lazy[2*x+2] self.lazy self lazy 2*x+2 2*x 2 x 2 self.lazy[x] self.lazy self lazy x 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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            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.lazy[x] self.lazy[2*x+1] self.lazy self lazy 2*x+1 2*x 2 x 1 self.lazy[x] self.lazy self lazy x self.lazy[2*x+2] = self.lazy[x] self.lazy[2*x+2] self.lazy self lazy 2*x+2 2*x 2 x 2 self.lazy[x] self.lazy self lazy x 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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            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.lazy[x] self.lazy[2*x+1] self.lazy self lazy 2*x+1 2*x 2 x 1 self.lazy[x] self.lazy self lazy x self.lazy[2*x+2] = self.lazy[x] self.lazy[2*x+2] self.lazy self lazy 2*x+2 2*x 2 x 2 self.lazy[x] self.lazy self lazy x 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 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 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 Qu = [list(map(int, input().split())) for _ in range(N)] Qu [list(map(int, input().split())) for _ in range(N)] Qu.sort(key=lambda x:x[2], reverse=True) Qu.sort Qu sort key=lambda x:x[2] key lambda x:x[2] x[2] x 2 x 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:
    S, T, X = q
    L = bisect_left(D,S-X)
    R = bisect_left(D,T-X)
    st.update(L, R, X) q Qu S, T, X = q S q T X 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" D = [int(input()) for _ in range(Q)] [int(input()) for _ in range(Q)] D st = DualSegmentTree(Q, op, e) DualSegmentTree(Q, op, e) st op = lambda x, y: x if x != e else y lambda x, y: x if x != e else y op L = bisect_left(D,S-X) bisect_left(D,S-X) L N, Q = map(int, input().split()) map(int, input().split()) N R = bisect_left(D,T-X) bisect_left(D,T-X) R S, T, X = q q S X = q q X Qu = [list(map(int, input().split())) for _ in range(N)] [list(map(int, input().split())) for _ in range(N)] Qu Q = map(int, input().split()) map(int, input().split()) Q 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] = x
            if l&1 == 0:
                self.lazy[l] = x
                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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            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] = x
            if l&1 == 0:
                self.lazy[l] = x
                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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            self.lazy[x] = self.e
        return str(self.lazy[self.size-1:self.size-1 + self.n])

################################################################################################################## DualSegmentTree input = sys.stdin.readline sys.stdin.readline input T, X = q q T e = -1 -1 e
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] = x
            if l&1 == 0:
                self.lazy[l] = x
                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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            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.lazy[x]
            self.lazy[2*x+2] = self.lazy[x]
            self.lazy[x] = self.e
        return str(self.lazy[self.size-1:self.size-1 + self.n])

##################################################################################################################
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 = [list(map(int, input().split())) for _ in range(N)]
Qu.sort(key=lambda x:x[2], reverse=True)

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

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