from heapq import heappush, heappop
from operator import itemgetter
import sys
input = sys.stdin.readline


class PseudoSet():
    def __init__(self):
        self.s = []  # set
        self.e = []  # erase candidate

    def insert(self, x):
        heappush(self.s, x)

    def erase(self, x):
        heappush(self.e, x)

    def get_min(self):
        while self.e and self.e[0] == self.s[0]:
            _ = heappop(self.s)
            _ = heappop(self.e)
        return self.s[0] if len(self.s) > 0 else None


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

ans = [-1] * q
events.sort(key=itemgetter(0, 1))
# print(events)
ps = PseudoSet()
for c, t, i in events:
    if t == 1:
        ps.insert(stx[i][2])
    elif t == -1:
        ps.erase(stx[i][2])
    else:
        # t == 0
        m = ps.get_min()
        if m is not None:
            ans[i] = m

print(*ans, sep='\n') from heapq import heappush, heappop from operator import itemgetter import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline class PseudoSet():
    def __init__(self):
        self.s = []  # set
        self.e = []  # erase candidate

    def insert(self, x):
        heappush(self.s, x)

    def erase(self, x):
        heappush(self.e, x)

    def get_min(self):
        while self.e and self.e[0] == self.s[0]:
            _ = heappop(self.s)
            _ = heappop(self.e)
        return self.s[0] if len(self.s) > 0 else None PseudoSet def __init__(self):
        self.s = []  # set
        self.e = []  # erase candidate

     __init__ self.s = [] self.s self s [] self.e = [] self.e self e [] self self def insert(self, x):
        heappush(self.s, x)

     insert heappush(self.s, x) heappush self.s self s x self self x x def erase(self, x):
        heappush(self.e, x)

     erase heappush(self.e, x) heappush self.e self e x self self x x def get_min(self):
        while self.e and self.e[0] == self.s[0]:
            _ = heappop(self.s)
            _ = heappop(self.e)
        return self.s[0] if len(self.s) > 0 else None get_min while self.e and self.e[0] == self.s[0]:
            _ = heappop(self.s)
            _ = heappop(self.e)
         self.e and self.e[0] == self.s[0] self.e self e self.e[0] == self.s[0] self.e[0] self.e self e 0 self.s[0] self.s self s 0 _ = heappop(self.s) _ heappop(self.s) heappop self.s self s _ = heappop(self.e) _ heappop(self.e) heappop self.e self e return self.s[0] if len(self.s) > 0 else None self.s[0] if len(self.s) > 0 else None len(self.s) > 0 len(self.s) len self.s self s 0 self.s[0] self.s self s 0 None self self n, q = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split q stx = [] stx [] events = [] events [] for i in range(n):
    s, t, x = map(int, input().split())
    stx.append((s, t, x))
    events.append((s - x, +1, i))
    events.append((t - x, -1, i)) i 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 stx.append((s, t, x)) stx.append stx append (s, t, x) s t x events.append((s - x, +1, i)) events.append events append (s - x, +1, i) s - x s x +1 1 i events.append((t - x, -1, i)) events.append events append (t - x, -1, i) t - x t x -1 i for i in range(q):
    d = int(input())
    events.append((d, 2, i)) i range(q) range q d = int(input()) d int(input()) int input() input events.append((d, 2, i)) events.append events append (d, 2, i) d 2 i ans = [-1] * q ans [-1] * q [-1] -1 q events.sort(key=itemgetter(0, 1)) events.sort events sort key=itemgetter(0, 1) key itemgetter(0, 1) itemgetter 0 1 ps = PseudoSet() ps PseudoSet() PseudoSet for c, t, i in events:
    if t == 1:
        ps.insert(stx[i][2])
    elif t == -1:
        ps.erase(stx[i][2])
    else:
        # t == 0
        m = ps.get_min()
        if m is not None:
            ans[i] = m c t i events if t == 1:
        ps.insert(stx[i][2])
    elif t == -1:
        ps.erase(stx[i][2])
    else:
        # t == 0
        m = ps.get_min()
        if m is not None:
            ans[i] = m t == 1 t 1 ps.insert(stx[i][2]) ps.insert ps insert stx[i][2] [i] stx i 2 elif t == -1:
        ps.erase(stx[i][2])
     t == -1 t -1 ps.erase(stx[i][2]) ps.erase ps erase stx[i][2] [i] stx i 2 m = ps.get_min() m ps.get_min() ps.get_min ps get_min if m is not None:
            ans[i] = m m is not None m None ans[i] = m ans[i] ans i m print(*ans, sep='\n') print *ans ans sep='\n' sep '\n' q = map(int, input().split()) map(int, input().split()) q t, x = map(int, input().split()) map(int, input().split()) t m = ps.get_min() ps.get_min() m x = map(int, input().split()) map(int, input().split()) x n, q = map(int, input().split()) map(int, input().split()) n d = int(input()) int(input()) d ps = PseudoSet() PseudoSet() ps ans = [-1] * q [-1] * q ans events = [] [] events stx = [] [] stx class PseudoSet():
    def __init__(self):
        self.s = []  # set
        self.e = []  # erase candidate

    def insert(self, x):
        heappush(self.s, x)

    def erase(self, x):
        heappush(self.e, x)

    def get_min(self):
        while self.e and self.e[0] == self.s[0]:
            _ = heappop(self.s)
            _ = heappop(self.e)
        return self.s[0] if len(self.s) > 0 else None class PseudoSet():
    def __init__(self):
        self.s = []  # set
        self.e = []  # erase candidate

    def insert(self, x):
        heappush(self.s, x)

    def erase(self, x):
        heappush(self.e, x)

    def get_min(self):
        while self.e and self.e[0] == self.s[0]:
            _ = heappop(self.s)
            _ = heappop(self.e)
        return self.s[0] if len(self.s) > 0 else None PseudoSet s, t, x = map(int, input().split()) map(int, input().split()) s input = sys.stdin.readline sys.stdin.readline input
from heapq import heappush, heappop
from operator import itemgetter
import sys
input = sys.stdin.readline


class PseudoSet():
    def __init__(self):
        self.s = []  # set
        self.e = []  # erase candidate

    def insert(self, x):
        heappush(self.s, x)

    def erase(self, x):
        heappush(self.e, x)

    def get_min(self):
        while self.e and self.e[0] == self.s[0]:
            _ = heappop(self.s)
            _ = heappop(self.e)
        return self.s[0] if len(self.s) > 0 else None


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

ans = [-1] * q
events.sort(key=itemgetter(0, 1))
# print(events)
ps = PseudoSet()
for c, t, i in events:
    if t == 1:
        ps.insert(stx[i][2])
    elif t == -1:
        ps.erase(stx[i][2])
    else:
        # t == 0
        m = ps.get_min()
        if m is not None:
            ans[i] = m

print(*ans, sep='\n')
