import heapq

class BalancingTree:
    def __init__(self):
        self.p = []
        self.q = []

    def insert(self, x):
        heapq.heappush(self.p, x)

    def erase(self, x):
        heapq.heappush(self.q, x)

    def minimum(self):
        while self.q and self.p[0] == self.q[0]:
            heapq.heappop(self.p)
            heapq.heappop(self.q)
        return self.p[0] if self.p else -1


n, q = map(int, input().split())
events = []
for _ in range(n):
    s, t, x = map(int, input().split())
    events.append((s-x, 1, x))
    events.append((t-x, 0, x))
for _ in range(q):
    d = int(input())
    events.append((d, 2, 0))

events.sort()
bt = BalancingTree()
for _, i, k in events:
    if i == 1:
        bt.insert(k)
    elif i == 0:
        bt.erase(k)
    else:
        print(bt.minimum()) import heapq heapq class BalancingTree:
    def __init__(self):
        self.p = []
        self.q = []

    def insert(self, x):
        heapq.heappush(self.p, x)

    def erase(self, x):
        heapq.heappush(self.q, x)

    def minimum(self):
        while self.q and self.p[0] == self.q[0]:
            heapq.heappop(self.p)
            heapq.heappop(self.q)
        return self.p[0] if self.p else -1 BalancingTree def __init__(self):
        self.p = []
        self.q = []

     __init__ self.p = [] self.p self p [] self.q = [] self.q self q [] self self def insert(self, x):
        heapq.heappush(self.p, x)

     insert heapq.heappush(self.p, x) heapq.heappush heapq heappush self.p self p x self self x x def erase(self, x):
        heapq.heappush(self.q, x)

     erase heapq.heappush(self.q, x) heapq.heappush heapq heappush self.q self q x self self x x def minimum(self):
        while self.q and self.p[0] == self.q[0]:
            heapq.heappop(self.p)
            heapq.heappop(self.q)
        return self.p[0] if self.p else -1 minimum while self.q and self.p[0] == self.q[0]:
            heapq.heappop(self.p)
            heapq.heappop(self.q)
         self.q and self.p[0] == self.q[0] self.q self q self.p[0] == self.q[0] self.p[0] self.p self p 0 self.q[0] self.q self q 0 heapq.heappop(self.p) heapq.heappop heapq heappop self.p self p heapq.heappop(self.q) heapq.heappop heapq heappop self.q self q return self.p[0] if self.p else -1 self.p[0] if self.p else -1 self.p self p self.p[0] self.p self p 0 -1 self self n, q = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split q events = [] events [] for _ in range(n):
    s, t, x = map(int, input().split())
    events.append((s-x, 1, x))
    events.append((t-x, 0, x)) _ range(n) range n s, t, x = map(int, input().split()) s map(int, input().split()) map int input().split() ().split () input split t x events.append((s-x, 1, x)) events.append events append (s-x, 1, x) s-x s x 1 x events.append((t-x, 0, x)) events.append events append (t-x, 0, x) t-x t x 0 x for _ in range(q):
    d = int(input())
    events.append((d, 2, 0)) _ range(q) range q d = int(input()) d int(input()) int input() input events.append((d, 2, 0)) events.append events append (d, 2, 0) d 2 0 events.sort() events.sort events sort bt = BalancingTree() bt BalancingTree() BalancingTree for _, i, k in events:
    if i == 1:
        bt.insert(k)
    elif i == 0:
        bt.erase(k)
    else:
        print(bt.minimum()) _ i k events if i == 1:
        bt.insert(k)
    elif i == 0:
        bt.erase(k)
    else:
        print(bt.minimum()) i == 1 i 1 bt.insert(k) bt.insert bt insert k elif i == 0:
        bt.erase(k)
     i == 0 i 0 bt.erase(k) bt.erase bt erase k print(bt.minimum()) print bt.minimum() bt.minimum bt minimum events = [] [] events x = map(int, input().split()) map(int, input().split()) x s, t, x = map(int, input().split()) map(int, input().split()) s class BalancingTree:
    def __init__(self):
        self.p = []
        self.q = []

    def insert(self, x):
        heapq.heappush(self.p, x)

    def erase(self, x):
        heapq.heappush(self.q, x)

    def minimum(self):
        while self.q and self.p[0] == self.q[0]:
            heapq.heappop(self.p)
            heapq.heappop(self.q)
        return self.p[0] if self.p else -1 class BalancingTree:
    def __init__(self):
        self.p = []
        self.q = []

    def insert(self, x):
        heapq.heappush(self.p, x)

    def erase(self, x):
        heapq.heappush(self.q, x)

    def minimum(self):
        while self.q and self.p[0] == self.q[0]:
            heapq.heappop(self.p)
            heapq.heappop(self.q)
        return self.p[0] if self.p else -1 BalancingTree t, x = map(int, input().split()) map(int, input().split()) t d = int(input()) int(input()) d n, q = map(int, input().split()) map(int, input().split()) n bt = BalancingTree() BalancingTree() bt q = map(int, input().split()) map(int, input().split()) q
import heapq

class BalancingTree:
    def __init__(self):
        self.p = []
        self.q = []

    def insert(self, x):
        heapq.heappush(self.p, x)

    def erase(self, x):
        heapq.heappush(self.q, x)

    def minimum(self):
        while self.q and self.p[0] == self.q[0]:
            heapq.heappop(self.p)
            heapq.heappop(self.q)
        return self.p[0] if self.p else -1


n, q = map(int, input().split())
events = []
for _ in range(n):
    s, t, x = map(int, input().split())
    events.append((s-x, 1, x))
    events.append((t-x, 0, x))
for _ in range(q):
    d = int(input())
    events.append((d, 2, 0))

events.sort()
bt = BalancingTree()
for _, i, k in events:
    if i == 1:
        bt.insert(k)
    elif i == 0:
        bt.erase(k)
    else:
        print(bt.minimum())
