import sys
import bisect

sys.setrecursionlimit(10**8)

class SegmentTree(object):  #1-indexed
    def __init__(self, size, value):
        self.len = 1 << size.bit_length()
        self.default = value
        # print(self.len)
        self.array = [value] * (2 * self.len)

    def get(self, i):
        i += self.len
        ans = self.default
        while i > 0:
            ans = min(self.array[i], ans)
            i >>= 1
        return ans

    def query(self, l, r, v, i, a, b):
        if self.array[i] != self.default:
            return 0
        if l == a and r == b:
            self.array[i] = v
            return 0
        center = (a + b) // 2
        if center >= r:
            return self.query(l, r, v, i * 2, a, center)
        elif center <= l:
            return self.query(l, r, v, i * 2 + 1, center, b) 
        else:
            return min(
                self.query(l, center, v, i * 2, a, center),
                self.query(center, r, v, i * 2 + 1, center, b))

    def update(self, l, r, v):
        return self.query(l, r, v, 1, 0, self.len)


input = sys.stdin.readline

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

STX_array = [list(map(int, input().split())) for _ in range(N)]

STX_array = sorted(STX_array, key=lambda x: x[2])

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

index_array = [i for i in range(Q)]

INF = 10**9 + 7

seg_tree = SegmentTree(Q, INF)

for STX in STX_array:
    s, t, x = STX
    index_left = bisect.bisect_left(Q_array, s - 0.5 - x)
    index_right = bisect.bisect_left(Q_array, t - 0.5 - x)
    if index_left != index_right:
        seg_tree.update(index_left, index_right, x)

for i in range(Q):
    ans = seg_tree.get(i)
    print(ans) if ans != INF else print(-1) import sys sys import bisect bisect sys.setrecursionlimit(10**8) sys.setrecursionlimit sys setrecursionlimit 10**8 10 8 class SegmentTree(object):  #1-indexed
    def __init__(self, size, value):
        self.len = 1 << size.bit_length()
        self.default = value
        # print(self.len)
        self.array = [value] * (2 * self.len)

    def get(self, i):
        i += self.len
        ans = self.default
        while i > 0:
            ans = min(self.array[i], ans)
            i >>= 1
        return ans

    def query(self, l, r, v, i, a, b):
        if self.array[i] != self.default:
            return 0
        if l == a and r == b:
            self.array[i] = v
            return 0
        center = (a + b) // 2
        if center >= r:
            return self.query(l, r, v, i * 2, a, center)
        elif center <= l:
            return self.query(l, r, v, i * 2 + 1, center, b) 
        else:
            return min(
                self.query(l, center, v, i * 2, a, center),
                self.query(center, r, v, i * 2 + 1, center, b))

    def update(self, l, r, v):
        return self.query(l, r, v, 1, 0, self.len) SegmentTree def __init__(self, size, value):
        self.len = 1 << size.bit_length()
        self.default = value
        # print(self.len)
        self.array = [value] * (2 * self.len)

     __init__ self.len = 1 << size.bit_length() self.len self len 1 << size.bit_length() 1 size.bit_length() size.bit_length size bit_length self.default = value self.default self default value self.array = [value] * (2 * self.len) self.array self array [value] * (2 * self.len) [value] value 2 * self.len 2 self.len self len self self size size value value def get(self, i):
        i += self.len
        ans = self.default
        while i > 0:
            ans = min(self.array[i], ans)
            i >>= 1
        return ans

     get i += self.len i self.len self len ans = self.default ans self.default self default while i > 0:
            ans = min(self.array[i], ans)
            i >>= 1
         i > 0 i 0 ans = min(self.array[i], ans) ans min(self.array[i], ans) min self.array[i] self.array self array i ans i >>= 1 i 1 return ans ans self self i i def query(self, l, r, v, i, a, b):
        if self.array[i] != self.default:
            return 0
        if l == a and r == b:
            self.array[i] = v
            return 0
        center = (a + b) // 2
        if center >= r:
            return self.query(l, r, v, i * 2, a, center)
        elif center <= l:
            return self.query(l, r, v, i * 2 + 1, center, b) 
        else:
            return min(
                self.query(l, center, v, i * 2, a, center),
                self.query(center, r, v, i * 2 + 1, center, b))

     query if self.array[i] != self.default:
            return 0
         self.array[i] != self.default self.array[i] self.array self array i self.default self default return 0 0 if l == a and r == b:
            self.array[i] = v
            return 0
         l == a and r == b l == a l a r == b r b self.array[i] = v self.array[i] self.array self array i v return 0 0 center = (a + b) // 2 center (a + b) // 2 a + b a b 2 if center >= r:
            return self.query(l, r, v, i * 2, a, center)
        elif center <= l:
            return self.query(l, r, v, i * 2 + 1, center, b) 
        else:
            return min(
                self.query(l, center, v, i * 2, a, center),
                self.query(center, r, v, i * 2 + 1, center, b))

     center >= r center r return self.query(l, r, v, i * 2, a, center) self.query(l, r, v, i * 2, a, center) self.query self query l r v i * 2 i 2 a center elif center <= l:
            return self.query(l, r, v, i * 2 + 1, center, b) 
         center <= l center l return self.query(l, r, v, i * 2 + 1, center, b) self.query(l, r, v, i * 2 + 1, center, b) self.query self query l r v i * 2 + 1 i * 2 i 2 1 center b return min(
                self.query(l, center, v, i * 2, a, center),
                self.query(center, r, v, i * 2 + 1, center, b)) min(
                self.query(l, center, v, i * 2, a, center),
                self.query(center, r, v, i * 2 + 1, center, b)) min self.query(l, center, v, i * 2, a, center) self.query self query l center v i * 2 i 2 a center self.query(center, r, v, i * 2 + 1, center, b) self.query self query center r v i * 2 + 1 i * 2 i 2 1 center b self self l l r r v v i i a a b b def update(self, l, r, v):
        return self.query(l, r, v, 1, 0, self.len) update return self.query(l, r, v, 1, 0, self.len) self.query(l, r, v, 1, 0, self.len) self.query self query l r v 1 0 self.len self len self self l l r r v v object 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 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 STX_array = [list(map(int, input().split())) for _ in range(N)] STX_array [list(map(int, input().split())) for _ in range(N)] STX_array = sorted(STX_array, key=lambda x: x[2]) STX_array sorted(STX_array, key=lambda x: x[2]) sorted STX_array key=lambda x: x[2] key lambda x: x[2] x[2] x 2 x int(input()) for _ in range(Q) for _ in range(Q) _ range(Q) range Q for _ in range(Q) int(input()) int input() input Q_array = [int(input()) for _ in range(Q)] Q_array [int(input()) for _ in range(Q)] i for i in range(Q) for i in range(Q) i range(Q) range Q for i in range(Q) i index_array = [i for i in range(Q)] index_array [i for i in range(Q)] INF = 10**9 + 7 INF 10**9 + 7 10**9 10 9 7 seg_tree = SegmentTree(Q, INF) seg_tree SegmentTree(Q, INF) SegmentTree Q INF for STX in STX_array:
    s, t, x = STX
    index_left = bisect.bisect_left(Q_array, s - 0.5 - x)
    index_right = bisect.bisect_left(Q_array, t - 0.5 - x)
    if index_left != index_right:
        seg_tree.update(index_left, index_right, x) STX STX_array s, t, x = STX s STX t x index_left = bisect.bisect_left(Q_array, s - 0.5 - x) index_left bisect.bisect_left(Q_array, s - 0.5 - x) bisect.bisect_left bisect bisect_left Q_array s - 0.5 - x s - 0.5 s 0.5 x index_right = bisect.bisect_left(Q_array, t - 0.5 - x) index_right bisect.bisect_left(Q_array, t - 0.5 - x) bisect.bisect_left bisect bisect_left Q_array t - 0.5 - x t - 0.5 t 0.5 x if index_left != index_right:
        seg_tree.update(index_left, index_right, x) index_left != index_right index_left index_right seg_tree.update(index_left, index_right, x) seg_tree.update seg_tree update index_left index_right x for i in range(Q):
    ans = seg_tree.get(i)
    print(ans) if ans != INF else print(-1) i range(Q) range Q ans = seg_tree.get(i) ans seg_tree.get(i) seg_tree.get seg_tree get i print(ans) if ans != INF else print(-1) ans != INF ans INF print(ans) print ans print(-1) print -1 Q = map(int, input().split()) map(int, input().split()) Q input = sys.stdin.readline sys.stdin.readline input seg_tree = SegmentTree(Q, INF) SegmentTree(Q, INF) seg_tree ans = seg_tree.get(i) seg_tree.get(i) ans index_array = [i for i in range(Q)] [i for i in range(Q)] index_array STX_array = [list(map(int, input().split())) for _ in range(N)] [list(map(int, input().split())) for _ in range(N)] STX_array t, x = STX STX t index_right = bisect.bisect_left(Q_array, t - 0.5 - x) bisect.bisect_left(Q_array, t - 0.5 - x) index_right STX_array = sorted(STX_array, key=lambda x: x[2]) sorted(STX_array, key=lambda x: x[2]) STX_array s, t, x = STX STX s x = STX STX x index_left = bisect.bisect_left(Q_array, s - 0.5 - x) bisect.bisect_left(Q_array, s - 0.5 - x) index_left N, Q = map(int, input().split()) map(int, input().split()) N Q_array = [int(input()) for _ in range(Q)] [int(input()) for _ in range(Q)] Q_array INF = 10**9 + 7 10**9 + 7 INF class SegmentTree(object):  #1-indexed
    def __init__(self, size, value):
        self.len = 1 << size.bit_length()
        self.default = value
        # print(self.len)
        self.array = [value] * (2 * self.len)

    def get(self, i):
        i += self.len
        ans = self.default
        while i > 0:
            ans = min(self.array[i], ans)
            i >>= 1
        return ans

    def query(self, l, r, v, i, a, b):
        if self.array[i] != self.default:
            return 0
        if l == a and r == b:
            self.array[i] = v
            return 0
        center = (a + b) // 2
        if center >= r:
            return self.query(l, r, v, i * 2, a, center)
        elif center <= l:
            return self.query(l, r, v, i * 2 + 1, center, b) 
        else:
            return min(
                self.query(l, center, v, i * 2, a, center),
                self.query(center, r, v, i * 2 + 1, center, b))

    def update(self, l, r, v):
        return self.query(l, r, v, 1, 0, self.len) class SegmentTree(object):  #1-indexed
    def __init__(self, size, value):
        self.len = 1 << size.bit_length()
        self.default = value
        # print(self.len)
        self.array = [value] * (2 * self.len)

    def get(self, i):
        i += self.len
        ans = self.default
        while i > 0:
            ans = min(self.array[i], ans)
            i >>= 1
        return ans

    def query(self, l, r, v, i, a, b):
        if self.array[i] != self.default:
            return 0
        if l == a and r == b:
            self.array[i] = v
            return 0
        center = (a + b) // 2
        if center >= r:
            return self.query(l, r, v, i * 2, a, center)
        elif center <= l:
            return self.query(l, r, v, i * 2 + 1, center, b) 
        else:
            return min(
                self.query(l, center, v, i * 2, a, center),
                self.query(center, r, v, i * 2 + 1, center, b))

    def update(self, l, r, v):
        return self.query(l, r, v, 1, 0, self.len) SegmentTree
import sys
import bisect

sys.setrecursionlimit(10**8)

class SegmentTree(object):  #1-indexed
    def __init__(self, size, value):
        self.len = 1 << size.bit_length()
        self.default = value
        # print(self.len)
        self.array = [value] * (2 * self.len)

    def get(self, i):
        i += self.len
        ans = self.default
        while i > 0:
            ans = min(self.array[i], ans)
            i >>= 1
        return ans

    def query(self, l, r, v, i, a, b):
        if self.array[i] != self.default:
            return 0
        if l == a and r == b:
            self.array[i] = v
            return 0
        center = (a + b) // 2
        if center >= r:
            return self.query(l, r, v, i * 2, a, center)
        elif center <= l:
            return self.query(l, r, v, i * 2 + 1, center, b) 
        else:
            return min(
                self.query(l, center, v, i * 2, a, center),
                self.query(center, r, v, i * 2 + 1, center, b))

    def update(self, l, r, v):
        return self.query(l, r, v, 1, 0, self.len)


input = sys.stdin.readline

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

STX_array = [list(map(int, input().split())) for _ in range(N)]

STX_array = sorted(STX_array, key=lambda x: x[2])

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

index_array = [i for i in range(Q)]

INF = 10**9 + 7

seg_tree = SegmentTree(Q, INF)

for STX in STX_array:
    s, t, x = STX
    index_left = bisect.bisect_left(Q_array, s - 0.5 - x)
    index_right = bisect.bisect_left(Q_array, t - 0.5 - x)
    if index_left != index_right:
        seg_tree.update(index_left, index_right, x)

for i in range(Q):
    ans = seg_tree.get(i)
    print(ans) if ans != INF else print(-1)