class DualSegmentTree():

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

    def built(self, array):
        """
        arrayを初期値とするセグメント木を構築
        """
        n, size, lazy = self.n, self.size, self.lazy
        for i in range(n):
            lazy[size + i] = array[i]

    def update(self, l, r, x):
        """
        半開区間 [l, r) の各々の要素 a に op(x, a)を作用させる （ 0-indexed ）　（ O(logN) ）
        """
        op, lazy = self.op, self.lazy
        l += self.size
        r += self.size
        self.propagate(l//(l&-l))
        self.propagate((r//(r&-r))-1)
        while l < r:
            if r&1:
                r -= 1              # 半開区間なので先に引いてる
                lazy[r] = op(x, lazy[r])
            if l&1:
                lazy[l] = op(x, lazy[l])
                l += 1
            l >>= 1
            r >>= 1

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

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

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

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

    def __str__(self):
        n, size, e, op, lazy = self.n, self.size, self.e, self.op, self.lazy
        for x in range(1, size):
            if lazy[x] == e:
                continue
            lazy[(x << 1) | 1] = op(lazy[x], lazy[(x << 1) | 1])
            lazy[x << 1] = op(lazy[x], lazy[x << 1])
            lazy[x] = e
        return str(lazy[size:size + 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.depth = (self.n - 1).bit_length()
        self.size = 1 << self.depth
        self.lazy = [self.e] * ((self.size << 1) + 1)

    def built(self, array):
        """
        arrayを初期値とするセグメント木を構築
        """
        n, size, lazy = self.n, self.size, self.lazy
        for i in range(n):
            lazy[size + i] = array[i]

    def update(self, l, r, x):
        """
        半開区間 [l, r) の各々の要素 a に op(x, a)を作用させる （ 0-indexed ）　（ O(logN) ）
        """
        op, lazy = self.op, self.lazy
        l += self.size
        r += self.size
        self.propagate(l//(l&-l))
        self.propagate((r//(r&-r))-1)
        while l < r:
            if r&1:
                r -= 1              # 半開区間なので先に引いてる
                lazy[r] = op(x, lazy[r])
            if l&1:
                lazy[l] = op(x, lazy[l])
                l += 1
            l >>= 1
            r >>= 1

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

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

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

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

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

################################################################################################################## DualSegmentTree def __init__(self, n, op, e):
        """
        :param n: 配列の要素数
        :param op: 作用素（モノイド＝結合則＋単位元存在）
        :param e:  単位元
        """
        self.n = n
        self.op = op
        self.e = e
        self.depth = (self.n - 1).bit_length()
        self.size = 1 << self.depth
        self.lazy = [self.e] * ((self.size << 1) + 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.depth = (self.n - 1).bit_length() self.depth self depth (self.n - 1).bit_length() self.n - 1).bit_length self.n - 1 self.n self n 1 bit_length self.size = 1 << self.depth self.size self size 1 << self.depth 1 self.depth self depth self.lazy = [self.e] * ((self.size << 1) + 1) self.lazy self lazy [self.e] * ((self.size << 1) + 1) [self.e] self.e self e (self.size << 1) + 1 self.size << 1 self.size self size 1 1 self self n n op op e e def built(self, array):
        """
        arrayを初期値とするセグメント木を構築
        """
        n, size, lazy = self.n, self.size, self.lazy
        for i in range(n):
            lazy[size + i] = array[i]

     built """
        arrayを初期値とするセグメント木を構築
        """ n, size, lazy = self.n, self.size, self.lazy n self.n self n size self.size self size lazy self.lazy self lazy for i in range(n):
            lazy[size + i] = array[i]

     i range(n) range n lazy[size + i] = array[i] lazy[size + i] lazy size + i size i array[i] array i self self array array def update(self, l, r, x):
        """
        半開区間 [l, r) の各々の要素 a に op(x, a)を作用させる （ 0-indexed ）　（ O(logN) ）
        """
        op, lazy = self.op, self.lazy
        l += self.size
        r += self.size
        self.propagate(l//(l&-l))
        self.propagate((r//(r&-r))-1)
        while l < r:
            if r&1:
                r -= 1              # 半開区間なので先に引いてる
                lazy[r] = op(x, lazy[r])
            if l&1:
                lazy[l] = op(x, lazy[l])
                l += 1
            l >>= 1
            r >>= 1

     update """
        半開区間 [l, r) の各々の要素 a に op(x, a)を作用させる （ 0-indexed ）　（ O(logN) ）
        """ op, lazy = self.op, self.lazy op self.op self op lazy self.lazy self lazy l += self.size l self.size self size r += self.size r self.size self size self.propagate(l//(l&-l)) self.propagate self propagate l//(l&-l) l l&-l l -l l self.propagate((r//(r&-r))-1) self.propagate self propagate (r//(r&-r))-1 r//(r&-r) r r&-r r -r r 1 while l < r:
            if r&1:
                r -= 1              # 半開区間なので先に引いてる
                lazy[r] = op(x, lazy[r])
            if l&1:
                lazy[l] = op(x, lazy[l])
                l += 1
            l >>= 1
            r >>= 1

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

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

     k range(i.bit_length()-1, 0,-1) range i.bit_length()-1 i.bit_length() i.bit_length i bit_length 1 0 -1 x = i>>k x i>>k i k if lazy[x] == e:
                continue
             lazy[x] == e lazy[x] lazy x e continue lazy[(x<<1)|1] = op(lazy[x], lazy[(x<<1)|1]) lazy[(x<<1)|1] lazy (x<<1)|1 x<<1 x 1 1 op(lazy[x], lazy[(x<<1)|1]) op lazy[x] lazy x lazy[(x<<1)|1] lazy (x<<1)|1 x<<1 x 1 1 lazy[x<<1] = op(lazy[x], lazy[x<<1]) lazy[x<<1] lazy x<<1 x 1 op(lazy[x], lazy[x<<1]) op lazy[x] lazy x lazy[x<<1] lazy x<<1 x 1 lazy[x] = e lazy[x] lazy x e self self i i def get(self, i):
        """
        i 番目の値を取得（ 0-indexed ） ( O(logN) )
        """
        i += self.size
        self.propagate(i)
        return self.lazy[i]

     get """
        i 番目の値を取得（ 0-indexed ） ( O(logN) )
        """ i += self.size i self.size self size 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):
        n, size, e, op, lazy = self.n, self.size, self.e, self.op, self.lazy
        for x in range(1, size):
            if lazy[x] == e:
                continue
            lazy[(x<<1)|1] = op(lazy[x], lazy[(x<<1)|1])
            lazy[x<<1] = op(lazy[x], lazy[x<<1])
            lazy[x] = e
        for a in lazy[size:size+n]:
            yield a

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

     a lazy[size:size+n] lazy size:size+n size size+n size n yield a a self self def __str__(self):
        n, size, e, op, lazy = self.n, self.size, self.e, self.op, self.lazy
        for x in range(1, size):
            if lazy[x] == e:
                continue
            lazy[(x << 1) | 1] = op(lazy[x], lazy[(x << 1) | 1])
            lazy[x << 1] = op(lazy[x], lazy[x << 1])
            lazy[x] = e
        return str(lazy[size:size + n])

################################################################################################################## __str__ n, size, e, op, lazy = self.n, self.size, self.e, self.op, self.lazy n self.n self n size self.size self size e self.e self e op self.op self op lazy self.lazy self lazy for x in range(1, size):
            if lazy[x] == e:
                continue
            lazy[(x << 1) | 1] = op(lazy[x], lazy[(x << 1) | 1])
            lazy[x << 1] = op(lazy[x], lazy[x << 1])
            lazy[x] = e
         x range(1, size) range 1 size if lazy[x] == e:
                continue
             lazy[x] == e lazy[x] lazy x e continue lazy[(x << 1) | 1] = op(lazy[x], lazy[(x << 1) | 1]) lazy[(x << 1) | 1] lazy (x << 1) | 1 x << 1 x 1 1 op(lazy[x], lazy[(x << 1) | 1]) op lazy[x] lazy x lazy[(x << 1) | 1] lazy (x << 1) | 1 x << 1 x 1 1 lazy[x << 1] = op(lazy[x], lazy[x << 1]) lazy[x << 1] lazy x << 1 x 1 op(lazy[x], lazy[x << 1]) op lazy[x] lazy x lazy[x << 1] lazy x << 1 x 1 lazy[x] = e lazy[x] lazy x e return str(lazy[size:size + n]) str(lazy[size:size + n]) str lazy[size:size + n] lazy size:size + n size size + n size 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" e = -1 -1 e L = bisect_left(D,S-X) bisect_left(D,S-X) L D = [int(input()) for _ in range(Q)] [int(input()) for _ in range(Q)] D R = bisect_left(D,T-X) bisect_left(D,T-X) R st = DualSegmentTree(Q, op, e) DualSegmentTree(Q, op, e) st Q = map(int, input().split()) map(int, input().split()) Q X = q q X N, Q = map(int, input().split()) map(int, input().split()) N Qu = [list(map(int, input().split())) for _ in range(N)] [list(map(int, input().split())) for _ in range(N)] Qu op = lambda x, y: x if x != e else y lambda x, y: x if x != e else y op S, T, X = q q S T, X = q q T class DualSegmentTree():

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

    def built(self, array):
        """
        arrayを初期値とするセグメント木を構築
        """
        n, size, lazy = self.n, self.size, self.lazy
        for i in range(n):
            lazy[size + i] = array[i]

    def update(self, l, r, x):
        """
        半開区間 [l, r) の各々の要素 a に op(x, a)を作用させる （ 0-indexed ）　（ O(logN) ）
        """
        op, lazy = self.op, self.lazy
        l += self.size
        r += self.size
        self.propagate(l//(l&-l))
        self.propagate((r//(r&-r))-1)
        while l < r:
            if r&1:
                r -= 1              # 半開区間なので先に引いてる
                lazy[r] = op(x, lazy[r])
            if l&1:
                lazy[l] = op(x, lazy[l])
                l += 1
            l >>= 1
            r >>= 1

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

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

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

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

    def __str__(self):
        n, size, e, op, lazy = self.n, self.size, self.e, self.op, self.lazy
        for x in range(1, size):
            if lazy[x] == e:
                continue
            lazy[(x << 1) | 1] = op(lazy[x], lazy[(x << 1) | 1])
            lazy[x << 1] = op(lazy[x], lazy[x << 1])
            lazy[x] = e
        return str(lazy[size:size + 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.depth = (self.n - 1).bit_length()
        self.size = 1 << self.depth
        self.lazy = [self.e] * ((self.size << 1) + 1)

    def built(self, array):
        """
        arrayを初期値とするセグメント木を構築
        """
        n, size, lazy = self.n, self.size, self.lazy
        for i in range(n):
            lazy[size + i] = array[i]

    def update(self, l, r, x):
        """
        半開区間 [l, r) の各々の要素 a に op(x, a)を作用させる （ 0-indexed ）　（ O(logN) ）
        """
        op, lazy = self.op, self.lazy
        l += self.size
        r += self.size
        self.propagate(l//(l&-l))
        self.propagate((r//(r&-r))-1)
        while l < r:
            if r&1:
                r -= 1              # 半開区間なので先に引いてる
                lazy[r] = op(x, lazy[r])
            if l&1:
                lazy[l] = op(x, lazy[l])
                l += 1
            l >>= 1
            r >>= 1

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

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

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

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

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

################################################################################################################## DualSegmentTree input = sys.stdin.readline sys.stdin.readline input
class DualSegmentTree():

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

    def built(self, array):
        """
        arrayを初期値とするセグメント木を構築
        """
        n, size, lazy = self.n, self.size, self.lazy
        for i in range(n):
            lazy[size + i] = array[i]

    def update(self, l, r, x):
        """
        半開区間 [l, r) の各々の要素 a に op(x, a)を作用させる （ 0-indexed ）　（ O(logN) ）
        """
        op, lazy = self.op, self.lazy
        l += self.size
        r += self.size
        self.propagate(l//(l&-l))
        self.propagate((r//(r&-r))-1)
        while l < r:
            if r&1:
                r -= 1              # 半開区間なので先に引いてる
                lazy[r] = op(x, lazy[r])
            if l&1:
                lazy[l] = op(x, lazy[l])
                l += 1
            l >>= 1
            r >>= 1

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

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

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

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

    def __str__(self):
        n, size, e, op, lazy = self.n, self.size, self.e, self.op, self.lazy
        for x in range(1, size):
            if lazy[x] == e:
                continue
            lazy[(x << 1) | 1] = op(lazy[x], lazy[(x << 1) | 1])
            lazy[x << 1] = op(lazy[x], lazy[x << 1])
            lazy[x] = e
        return str(lazy[size:size + 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")
