class DualSegmentTree():

    def __init__(self, n, op, 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 update(self, l, r, x):
        l += self.size
        r += self.size
        self.propagate(l)
        self.propagate(r-1)
        while l < r:
            if r&1:
                r -= 1              # 半開区間なので先に引いてる
                self.lazy[r] = self.op(x, self.lazy[r])
            if l&1:
                self.lazy[l] = self.op(x, self.lazy[l])
                l += 1
            l = l // 2
            r = r // 2

    def propagate(self, i):
        for k in range(self.depth,0,-1):
            x = i>>k
            if self.lazy[x] == self.e:
                continue
            self.lazy[(x<<1)+1] = self.op(self.lazy[x], self.lazy[(x<<1)+1])
            self.lazy[x<<1] = self.op(self.lazy[x], self.lazy[x<<1])
            self.lazy[x] = self.e

    def get(self, i):
        i += self.size
        self.propagate(i)
        return self.lazy[i]

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

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

    def __str__(self):
        for x in range(1, self.size):
            if self.lazy[x] == self.e:
                continue
            self.lazy[(x<<1)+1] = self.op(self.lazy[x], self.lazy[(x<<1)+1])
            self.lazy[x<<1] = self.op(self.lazy[x], self.lazy[x<<1])
            self.lazy[x] = self.e
        return str(self.lazy[self.size:self.size + 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):
        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 update(self, l, r, x):
        l += self.size
        r += self.size
        self.propagate(l)
        self.propagate(r-1)
        while l < r:
            if r&1:
                r -= 1              # 半開区間なので先に引いてる
                self.lazy[r] = self.op(x, self.lazy[r])
            if l&1:
                self.lazy[l] = self.op(x, self.lazy[l])
                l += 1
            l = l // 2
            r = r // 2

    def propagate(self, i):
        for k in range(self.depth,0,-1):
            x = i>>k
            if self.lazy[x] == self.e:
                continue
            self.lazy[(x<<1)+1] = self.op(self.lazy[x], self.lazy[(x<<1)+1])
            self.lazy[x<<1] = self.op(self.lazy[x], self.lazy[x<<1])
            self.lazy[x] = self.e

    def get(self, i):
        i += self.size
        self.propagate(i)
        return self.lazy[i]

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

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

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

################################################################################################################## DualSegmentTree def __init__(self, n, op, 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__ 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 update(self, l, r, x):
        l += self.size
        r += self.size
        self.propagate(l)
        self.propagate(r-1)
        while l < r:
            if r&1:
                r -= 1              # 半開区間なので先に引いてる
                self.lazy[r] = self.op(x, self.lazy[r])
            if l&1:
                self.lazy[l] = self.op(x, self.lazy[l])
                l += 1
            l = l // 2
            r = r // 2

     update l += self.size l self.size self size r += self.size r self.size self size 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:
                r -= 1              # 半開区間なので先に引いてる
                self.lazy[r] = self.op(x, self.lazy[r])
            if l&1:
                self.lazy[l] = self.op(x, self.lazy[l])
                l += 1
            l = l // 2
            r = r // 2

     l < r l r if r&1:
                r -= 1              # 半開区間なので先に引いてる
                self.lazy[r] = self.op(x, self.lazy[r])
             r&1 r 1 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:
                self.lazy[l] = self.op(x, self.lazy[l])
                l += 1
             l&1 l 1 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 // 2 l l // 2 l 2 r = r // 2 r r // 2 r 2 self self l l r r x x def propagate(self, i):
        for k in range(self.depth,0,-1):
            x = i>>k
            if self.lazy[x] == self.e:
                continue
            self.lazy[(x<<1)+1] = self.op(self.lazy[x], self.lazy[(x<<1)+1])
            self.lazy[x<<1] = self.op(self.lazy[x], self.lazy[x<<1])
            self.lazy[x] = self.e

     propagate for k in range(self.depth,0,-1):
            x = i>>k
            if self.lazy[x] == self.e:
                continue
            self.lazy[(x<<1)+1] = self.op(self.lazy[x], self.lazy[(x<<1)+1])
            self.lazy[x<<1] = self.op(self.lazy[x], self.lazy[x<<1])
            self.lazy[x] = self.e

     k range(self.depth,0,-1) range self.depth self depth 0 -1 x = i>>k x i>>k i k 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[(x<<1)+1] = self.op(self.lazy[x], self.lazy[(x<<1)+1]) self.lazy[(x<<1)+1] self.lazy self lazy (x<<1)+1 x<<1 x 1 1 self.op(self.lazy[x], self.lazy[(x<<1)+1]) self.op self op self.lazy[x] self.lazy self lazy x self.lazy[(x<<1)+1] self.lazy self lazy (x<<1)+1 x<<1 x 1 1 self.lazy[x<<1] = self.op(self.lazy[x], self.lazy[x<<1]) self.lazy[x<<1] self.lazy self lazy x<<1 x 1 self.op(self.lazy[x], self.lazy[x<<1]) self.op self op self.lazy[x] self.lazy self lazy x self.lazy[x<<1] self.lazy self lazy x<<1 x 1 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 += self.size
        self.propagate(i)
        return self.lazy[i]

     get 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):
        for x in range(1, self.size):
            if self.lazy[x] == self.e:
                continue
            self.lazy[(x<<1)+1] = self.op(self.lazy[x], self.lazy[(x<<1)+1])
            self.lazy[x<<1] = self.op(self.lazy[x], self.lazy[x<<1])
            self.lazy[x] = self.e
        for a in self.lazy[self.size:self.size+self.n]:
            yield a

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

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

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

    def __init__(self, n, op, 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 update(self, l, r, x):
        l += self.size
        r += self.size
        self.propagate(l)
        self.propagate(r-1)
        while l < r:
            if r&1:
                r -= 1              # 半開区間なので先に引いてる
                self.lazy[r] = self.op(x, self.lazy[r])
            if l&1:
                self.lazy[l] = self.op(x, self.lazy[l])
                l += 1
            l = l // 2
            r = r // 2

    def propagate(self, i):
        for k in range(self.depth,0,-1):
            x = i>>k
            if self.lazy[x] == self.e:
                continue
            self.lazy[(x<<1)+1] = self.op(self.lazy[x], self.lazy[(x<<1)+1])
            self.lazy[x<<1] = self.op(self.lazy[x], self.lazy[x<<1])
            self.lazy[x] = self.e

    def get(self, i):
        i += self.size
        self.propagate(i)
        return self.lazy[i]

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

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

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

################################################################################################################## class DualSegmentTree():

    def __init__(self, n, op, 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 update(self, l, r, x):
        l += self.size
        r += self.size
        self.propagate(l)
        self.propagate(r-1)
        while l < r:
            if r&1:
                r -= 1              # 半開区間なので先に引いてる
                self.lazy[r] = self.op(x, self.lazy[r])
            if l&1:
                self.lazy[l] = self.op(x, self.lazy[l])
                l += 1
            l = l // 2
            r = r // 2

    def propagate(self, i):
        for k in range(self.depth,0,-1):
            x = i>>k
            if self.lazy[x] == self.e:
                continue
            self.lazy[(x<<1)+1] = self.op(self.lazy[x], self.lazy[(x<<1)+1])
            self.lazy[x<<1] = self.op(self.lazy[x], self.lazy[x<<1])
            self.lazy[x] = self.e

    def get(self, i):
        i += self.size
        self.propagate(i)
        return self.lazy[i]

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

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

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

################################################################################################################## DualSegmentTree S, T, X = q q S X = q q X T, X = q q T R = bisect_left(D,T-X) bisect_left(D,T-X) R st = DualSegmentTree(Q, op, e) DualSegmentTree(Q, op, e) st N, Q = map(int, input().split()) map(int, input().split()) N D = [int(input()) for _ in range(Q)] [int(input()) for _ in range(Q)] D e = -1 -1 e L = bisect_left(D,S-X) bisect_left(D,S-X) L Qu = [list(map(int, input().split())) for _ in range(N)] [list(map(int, input().split())) for _ in range(N)] Qu
class DualSegmentTree():

    def __init__(self, n, op, 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 update(self, l, r, x):
        l += self.size
        r += self.size
        self.propagate(l)
        self.propagate(r-1)
        while l < r:
            if r&1:
                r -= 1              # 半開区間なので先に引いてる
                self.lazy[r] = self.op(x, self.lazy[r])
            if l&1:
                self.lazy[l] = self.op(x, self.lazy[l])
                l += 1
            l = l // 2
            r = r // 2

    def propagate(self, i):
        for k in range(self.depth,0,-1):
            x = i>>k
            if self.lazy[x] == self.e:
                continue
            self.lazy[(x<<1)+1] = self.op(self.lazy[x], self.lazy[(x<<1)+1])
            self.lazy[x<<1] = self.op(self.lazy[x], self.lazy[x<<1])
            self.lazy[x] = self.e

    def get(self, i):
        i += self.size
        self.propagate(i)
        return self.lazy[i]

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

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

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