import sys
input = sys.stdin.readline
inf = float('inf')
mod = 10**9+7


def INT_(n): return int(n)-1


def MI(): return map(int, input().split())


def MF(): return map(float, input().split())


def MI_(): return map(INT_, input().split())


def LI(): return list(MI())


def LI_(): return [int(x) - 1 for x in input().split()]


def LF(): return list(MF())


def LIN(n: int): return [input() for _ in range(n)]


def LLIN(n: int): return [LI() for _ in range(n)]


def LLIN_(n: int): return [LI_() for _ in range(n)]


def LLI(): return [list(map(int, l.split())) for l in input()]


def I(): return int(input())


def F(): return float(input())


def ST(): return input().replace('\n', '')


def main():
    import heapq
    N, Q = MI()
    event = []
    for _ in range(N):
        s, t, x = MI()
        event.append((s - x-0.5, 1, x))
        event.append((t - x-0.5, -1, x))

    for _ in range(Q):
        d = I()
        event.append((d, 0))

    # クエリも含めてソート
    event.sort(key=lambda x: x[0])

    # 工事現場が一番近いところを探すのにO(N)かけると死ぬのでlogNで調べることができるように優先度付きキューも使う
    occur = set()
    occur_priority = []

    for e in event:
        # 工事開始
        if e[1] == 1:
            occur.add(e[2])
            heapq.heappush(occur_priority, e[2])

        # 工事終了 occurはsetなので2回先に追加されたあとに2回削除ということを考慮
        elif e[1] == -1:
            if e[2] in occur:
                occur.remove(e[2])
            # heap木の要素の削除は遅いので、クエリのときに消す

        # クエリ
        elif e[1] == 0:
            if occur:
                while 1:
                    if occur_priority[0] in occur:
                        min_occur = occur_priority[0]
                        break
                    else:
                        heapq.heappop(occur_priority)
                print(min_occur)
            else:
                print(-1)


if __name__ == '__main__':
    main() import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline inf = float('inf') inf float('inf') float 'inf' mod = 10**9+7 mod 10**9+7 10**9 10 9 7 def INT_(n): return int(n)-1 INT_ n n def MI(): return map(int, input().split()) MI def MF(): return map(float, input().split()) MF def MI_(): return map(INT_, input().split()) MI_ def LI(): return list(MI()) LI int(x) - 1 for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) - 1 int(x) int x 1 def LI_(): return [int(x) - 1 for x in input().split()] LI_ def LF(): return list(MF()) LF input() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) input() input def LIN(n: int): return [input() for _ in range(n)] LIN n: int n LI() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) LI() LI def LLIN(n: int): return [LI() for _ in range(n)] LLIN n: int n LI_() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) LI_() LI_ def LLIN_(n: int): return [LI_() for _ in range(n)] LLIN_ n: int n list(map(int, l.split())) for l in input() for l in input() l input() input for l in input() list(map(int, l.split())) list map(int, l.split()) map int l.split() l.split l split def LLI(): return [list(map(int, l.split())) for l in input()] LLI def I(): return int(input()) I def F(): return float(input()) F def ST(): return input().replace('\n', '') ST def main():
    import heapq
    N, Q = MI()
    event = []
    for _ in range(N):
        s, t, x = MI()
        event.append((s - x-0.5, 1, x))
        event.append((t - x-0.5, -1, x))

    for _ in range(Q):
        d = I()
        event.append((d, 0))

    # クエリも含めてソート
    event.sort(key=lambda x: x[0])

    # 工事現場が一番近いところを探すのにO(N)かけると死ぬのでlogNで調べることができるように優先度付きキューも使う
    occur = set()
    occur_priority = []

    for e in event:
        # 工事開始
        if e[1] == 1:
            occur.add(e[2])
            heapq.heappush(occur_priority, e[2])

        # 工事終了 occurはsetなので2回先に追加されたあとに2回削除ということを考慮
        elif e[1] == -1:
            if e[2] in occur:
                occur.remove(e[2])
            # heap木の要素の削除は遅いので、クエリのときに消す

        # クエリ
        elif e[1] == 0:
            if occur:
                while 1:
                    if occur_priority[0] in occur:
                        min_occur = occur_priority[0]
                        break
                    else:
                        heapq.heappop(occur_priority)
                print(min_occur)
            else:
                print(-1) main import heapq heapq N, Q = MI() N MI() MI Q event = [] event [] for _ in range(N):
        s, t, x = MI()
        event.append((s - x-0.5, 1, x))
        event.append((t - x-0.5, -1, x))

     _ range(N) range N s, t, x = MI() s MI() MI t x event.append((s - x-0.5, 1, x)) event.append event append (s - x-0.5, 1, x) s - x-0.5 s - x s x 0.5 1 x event.append((t - x-0.5, -1, x)) event.append event append (t - x-0.5, -1, x) t - x-0.5 t - x t x 0.5 -1 x for _ in range(Q):
        d = I()
        event.append((d, 0))

    # クエリも含めてソート
     _ range(Q) range Q d = I() d I() I event.append((d, 0)) event.append event append (d, 0) d 0 event.sort(key=lambda x: x[0]) event.sort event sort key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x occur = set() occur set() set occur_priority = [] occur_priority [] for e in event:
        # 工事開始
        if e[1] == 1:
            occur.add(e[2])
            heapq.heappush(occur_priority, e[2])

        # 工事終了 occurはsetなので2回先に追加されたあとに2回削除ということを考慮
        elif e[1] == -1:
            if e[2] in occur:
                occur.remove(e[2])
            # heap木の要素の削除は遅いので、クエリのときに消す

        # クエリ
        elif e[1] == 0:
            if occur:
                while 1:
                    if occur_priority[0] in occur:
                        min_occur = occur_priority[0]
                        break
                    else:
                        heapq.heappop(occur_priority)
                print(min_occur)
            else:
                print(-1) e event if e[1] == 1:
            occur.add(e[2])
            heapq.heappush(occur_priority, e[2])

        # 工事終了 occurはsetなので2回先に追加されたあとに2回削除ということを考慮
        elif e[1] == -1:
            if e[2] in occur:
                occur.remove(e[2])
            # heap木の要素の削除は遅いので、クエリのときに消す

        # クエリ
        elif e[1] == 0:
            if occur:
                while 1:
                    if occur_priority[0] in occur:
                        min_occur = occur_priority[0]
                        break
                    else:
                        heapq.heappop(occur_priority)
                print(min_occur)
            else:
                print(-1) e[1] == 1 e[1] e 1 1 occur.add(e[2]) occur.add occur add e[2] e 2 heapq.heappush(occur_priority, e[2]) heapq.heappush heapq heappush occur_priority e[2] e 2 elif e[1] == -1:
            if e[2] in occur:
                occur.remove(e[2])
            # heap木の要素の削除は遅いので、クエリのときに消す

        # クエリ
         e[1] == -1 e[1] e 1 -1 if e[2] in occur:
                occur.remove(e[2])
            # heap木の要素の削除は遅いので、クエリのときに消す

        # クエリ
         e[2] in occur e[2] e 2 occur occur.remove(e[2]) occur.remove occur remove e[2] e 2 elif e[1] == 0:
            if occur:
                while 1:
                    if occur_priority[0] in occur:
                        min_occur = occur_priority[0]
                        break
                    else:
                        heapq.heappop(occur_priority)
                print(min_occur)
            else:
                print(-1) e[1] == 0 e[1] e 1 0 if occur:
                while 1:
                    if occur_priority[0] in occur:
                        min_occur = occur_priority[0]
                        break
                    else:
                        heapq.heappop(occur_priority)
                print(min_occur)
            else:
                print(-1) occur while 1:
                    if occur_priority[0] in occur:
                        min_occur = occur_priority[0]
                        break
                    else:
                        heapq.heappop(occur_priority)
                 1 if occur_priority[0] in occur:
                        min_occur = occur_priority[0]
                        break
                    else:
                        heapq.heappop(occur_priority)
                 occur_priority[0] in occur occur_priority[0] occur_priority 0 occur min_occur = occur_priority[0] min_occur occur_priority[0] occur_priority 0 break heapq.heappop(occur_priority) heapq.heappop heapq heappop occur_priority print(min_occur) print min_occur print(-1) print -1 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def INT_(n): return int(n)-1 def INT_(n): return int(n)-1 INT_ def I(): return int(input()) def I(): return int(input()) I def LI_(): return [int(x) - 1 for x in input().split()] def LI_(): return [int(x) - 1 for x in input().split()] LI_ def LIN(n: int): return [input() for _ in range(n)] def LIN(n: int): return [input() for _ in range(n)] LIN def F(): return float(input()) def F(): return float(input()) F def LLI(): return [list(map(int, l.split())) for l in input()] def LLI(): return [list(map(int, l.split())) for l in input()] LLI mod = 10**9+7 10**9+7 mod def LF(): return list(MF()) def LF(): return list(MF()) LF def LLIN_(n: int): return [LI_() for _ in range(n)] def LLIN_(n: int): return [LI_() for _ in range(n)] LLIN_ def MI(): return map(int, input().split()) def MI(): return map(int, input().split()) MI input = sys.stdin.readline sys.stdin.readline input def MF(): return map(float, input().split()) def MF(): return map(float, input().split()) MF def LI(): return list(MI()) def LI(): return list(MI()) LI def ST(): return input().replace('\n', '') def ST(): return input().replace('\n', '') ST inf = float('inf') float('inf') inf def main():
    import heapq
    N, Q = MI()
    event = []
    for _ in range(N):
        s, t, x = MI()
        event.append((s - x-0.5, 1, x))
        event.append((t - x-0.5, -1, x))

    for _ in range(Q):
        d = I()
        event.append((d, 0))

    # クエリも含めてソート
    event.sort(key=lambda x: x[0])

    # 工事現場が一番近いところを探すのにO(N)かけると死ぬのでlogNで調べることができるように優先度付きキューも使う
    occur = set()
    occur_priority = []

    for e in event:
        # 工事開始
        if e[1] == 1:
            occur.add(e[2])
            heapq.heappush(occur_priority, e[2])

        # 工事終了 occurはsetなので2回先に追加されたあとに2回削除ということを考慮
        elif e[1] == -1:
            if e[2] in occur:
                occur.remove(e[2])
            # heap木の要素の削除は遅いので、クエリのときに消す

        # クエリ
        elif e[1] == 0:
            if occur:
                while 1:
                    if occur_priority[0] in occur:
                        min_occur = occur_priority[0]
                        break
                    else:
                        heapq.heappop(occur_priority)
                print(min_occur)
            else:
                print(-1) def main():
    import heapq
    N, Q = MI()
    event = []
    for _ in range(N):
        s, t, x = MI()
        event.append((s - x-0.5, 1, x))
        event.append((t - x-0.5, -1, x))

    for _ in range(Q):
        d = I()
        event.append((d, 0))

    # クエリも含めてソート
    event.sort(key=lambda x: x[0])

    # 工事現場が一番近いところを探すのにO(N)かけると死ぬのでlogNで調べることができるように優先度付きキューも使う
    occur = set()
    occur_priority = []

    for e in event:
        # 工事開始
        if e[1] == 1:
            occur.add(e[2])
            heapq.heappush(occur_priority, e[2])

        # 工事終了 occurはsetなので2回先に追加されたあとに2回削除ということを考慮
        elif e[1] == -1:
            if e[2] in occur:
                occur.remove(e[2])
            # heap木の要素の削除は遅いので、クエリのときに消す

        # クエリ
        elif e[1] == 0:
            if occur:
                while 1:
                    if occur_priority[0] in occur:
                        min_occur = occur_priority[0]
                        break
                    else:
                        heapq.heappop(occur_priority)
                print(min_occur)
            else:
                print(-1) main def MI_(): return map(INT_, input().split()) def MI_(): return map(INT_, input().split()) MI_ def LLIN(n: int): return [LI() for _ in range(n)] def LLIN(n: int): return [LI() for _ in range(n)] LLIN
import sys
input = sys.stdin.readline
inf = float('inf')
mod = 10**9+7


def INT_(n): return int(n)-1


def MI(): return map(int, input().split())


def MF(): return map(float, input().split())


def MI_(): return map(INT_, input().split())


def LI(): return list(MI())


def LI_(): return [int(x) - 1 for x in input().split()]


def LF(): return list(MF())


def LIN(n: int): return [input() for _ in range(n)]


def LLIN(n: int): return [LI() for _ in range(n)]


def LLIN_(n: int): return [LI_() for _ in range(n)]


def LLI(): return [list(map(int, l.split())) for l in input()]


def I(): return int(input())


def F(): return float(input())


def ST(): return input().replace('\n', '')


def main():
    import heapq
    N, Q = MI()
    event = []
    for _ in range(N):
        s, t, x = MI()
        event.append((s - x-0.5, 1, x))
        event.append((t - x-0.5, -1, x))

    for _ in range(Q):
        d = I()
        event.append((d, 0))

    # クエリも含めてソート
    event.sort(key=lambda x: x[0])

    # 工事現場が一番近いところを探すのにO(N)かけると死ぬのでlogNで調べることができるように優先度付きキューも使う
    occur = set()
    occur_priority = []

    for e in event:
        # 工事開始
        if e[1] == 1:
            occur.add(e[2])
            heapq.heappush(occur_priority, e[2])

        # 工事終了 occurはsetなので2回先に追加されたあとに2回削除ということを考慮
        elif e[1] == -1:
            if e[2] in occur:
                occur.remove(e[2])
            # heap木の要素の削除は遅いので、クエリのときに消す

        # クエリ
        elif e[1] == 0:
            if occur:
                while 1:
                    if occur_priority[0] in occur:
                        min_occur = occur_priority[0]
                        break
                    else:
                        heapq.heappop(occur_priority)
                print(min_occur)
            else:
                print(-1)


if __name__ == '__main__':
    main()
