import sys
sys.setrecursionlimit(300000)
from bisect import bisect_left

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


# 区間updateと要素クエリ
class SegmentTree(object):

    def __init__(self, n, e, fn):
        self.fn = fn
        self.length = 1 << n.bit_length()
        self.data = [e] * (self.length * 2)

    # 区間[l, r)の値とxをfnで比較して更新する
    def update(self, l, r, x):  # O(logN)
        l += self.length
        r += self.length
        while l < r:
            if l & 1:
                self.data[l] = self.fn(self.data[l], x)
                l += 1
            if r & 1:
                self.data[r - 1] = self.fn(self.data[r - 1], x)
                r -= 1
            l //= 2
            r //= 2

    # i番目の要素の値を取得する
    def query(self, i):  # O(logN)
        i += len(self.data) // 2
        ret = self.data[i]
        while i > 0:
            i //= 2
            ret = self.fn(ret, self.data[i])
        return ret

N, Q = MI()
STX = [tuple(MI()) for _ in range(N)]
D = [I() for _ in range(Q)]

seg = SegmentTree(Q, INF, min)
for S, T, X in STX:
    # [S - X, T - X) に出発する人[l番目の人, r番目の人)が影響を受ける
    l = bisect_left(D, S - X)
    r = bisect_left(D, T - X)
    seg.update(l, r, X)

for i in range(Q):
    ans = seg.query(i)
    if ans == INF:
        print(-1)
    else:
        print(ans) import sys sys sys.setrecursionlimit(300000) sys.setrecursionlimit sys setrecursionlimit 300000 from bisect import bisect_left def I(): return int(sys.stdin.readline()) I def MI(): return map(int, sys.stdin.readline().split()) MI def LMI(): return list(map(int, sys.stdin.readline().split())) LMI MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 INF = float('inf') INF float('inf') float 'inf' class SegmentTree(object):

    def __init__(self, n, e, fn):
        self.fn = fn
        self.length = 1 << n.bit_length()
        self.data = [e] * (self.length * 2)

    # 区間[l, r)の値とxをfnで比較して更新する
    def update(self, l, r, x):  # O(logN)
        l += self.length
        r += self.length
        while l < r:
            if l & 1:
                self.data[l] = self.fn(self.data[l], x)
                l += 1
            if r & 1:
                self.data[r - 1] = self.fn(self.data[r - 1], x)
                r -= 1
            l //= 2
            r //= 2

    # i番目の要素の値を取得する
    def query(self, i):  # O(logN)
        i += len(self.data) // 2
        ret = self.data[i]
        while i > 0:
            i //= 2
            ret = self.fn(ret, self.data[i])
        return ret SegmentTree def __init__(self, n, e, fn):
        self.fn = fn
        self.length = 1 << n.bit_length()
        self.data = [e] * (self.length * 2)

    # 区間[l, r)の値とxをfnで比較して更新する
     __init__ self.fn = fn self.fn self fn fn self.length = 1 << n.bit_length() self.length self length 1 << n.bit_length() 1 n.bit_length() n.bit_length n bit_length self.data = [e] * (self.length * 2) self.data self data [e] * (self.length * 2) [e] e self.length * 2 self.length self length 2 self self n n e e fn fn def update(self, l, r, x):  # O(logN)
        l += self.length
        r += self.length
        while l < r:
            if l & 1:
                self.data[l] = self.fn(self.data[l], x)
                l += 1
            if r & 1:
                self.data[r - 1] = self.fn(self.data[r - 1], x)
                r -= 1
            l //= 2
            r //= 2

    # i番目の要素の値を取得する
     update l += self.length l self.length self length r += self.length r self.length self length while l < r:
            if l & 1:
                self.data[l] = self.fn(self.data[l], x)
                l += 1
            if r & 1:
                self.data[r - 1] = self.fn(self.data[r - 1], x)
                r -= 1
            l //= 2
            r //= 2

    # i番目の要素の値を取得する
     l < r l r if l & 1:
                self.data[l] = self.fn(self.data[l], x)
                l += 1
             l & 1 l 1 self.data[l] = self.fn(self.data[l], x) self.data[l] self.data self data l self.fn(self.data[l], x) self.fn self fn self.data[l] self.data self data l x l += 1 l 1 if r & 1:
                self.data[r - 1] = self.fn(self.data[r - 1], x)
                r -= 1
             r & 1 r 1 self.data[r - 1] = self.fn(self.data[r - 1], x) self.data[r - 1] self.data self data r - 1 r 1 self.fn(self.data[r - 1], x) self.fn self fn self.data[r - 1] self.data self data r - 1 r 1 x r -= 1 r 1 l //= 2 l 2 r //= 2 r 2 self self l l r r x x def query(self, i):  # O(logN)
        i += len(self.data) // 2
        ret = self.data[i]
        while i > 0:
            i //= 2
            ret = self.fn(ret, self.data[i])
        return ret query i += len(self.data) // 2 i len(self.data) // 2 len(self.data) len self.data self data 2 ret = self.data[i] ret self.data[i] self.data self data i while i > 0:
            i //= 2
            ret = self.fn(ret, self.data[i])
         i > 0 i 0 i //= 2 i 2 ret = self.fn(ret, self.data[i]) ret self.fn(ret, self.data[i]) self.fn self fn ret self.data[i] self.data self data i return ret ret self self i i object N, Q = MI() N MI() MI Q tuple(MI()) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) tuple(MI()) tuple MI() MI STX = [tuple(MI()) for _ in range(N)] STX [tuple(MI()) for _ in range(N)] I() for _ in range(Q) for _ in range(Q) _ range(Q) range Q for _ in range(Q) I() I D = [I() for _ in range(Q)] D [I() for _ in range(Q)] seg = SegmentTree(Q, INF, min) seg SegmentTree(Q, INF, min) SegmentTree Q INF min for S, T, X in STX:
    # [S - X, T - X) に出発する人[l番目の人, r番目の人)が影響を受ける
    l = bisect_left(D, S - X)
    r = bisect_left(D, T - X)
    seg.update(l, r, X) S T X STX 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 seg.update(l, r, X) seg.update seg update l r X for i in range(Q):
    ans = seg.query(i)
    if ans == INF:
        print(-1)
    else:
        print(ans) i range(Q) range Q ans = seg.query(i) ans seg.query(i) seg.query seg query i if ans == INF:
        print(-1)
    else:
        print(ans) ans == INF ans INF print(-1) print -1 print(ans) print ans Q = MI() MI() Q seg = SegmentTree(Q, INF, min) SegmentTree(Q, INF, min) seg N, Q = MI() MI() N D = [I() for _ in range(Q)] [I() for _ in range(Q)] D def I(): return int(sys.stdin.readline()) def I(): return int(sys.stdin.readline()) I STX = [tuple(MI()) for _ in range(N)] [tuple(MI()) for _ in range(N)] STX l = bisect_left(D, S - X) bisect_left(D, S - X) l def MI(): return map(int, sys.stdin.readline().split()) def MI(): return map(int, sys.stdin.readline().split()) MI MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD ans = seg.query(i) seg.query(i) ans r = bisect_left(D, T - X) bisect_left(D, T - X) r INF = float('inf') float('inf') INF class SegmentTree(object):

    def __init__(self, n, e, fn):
        self.fn = fn
        self.length = 1 << n.bit_length()
        self.data = [e] * (self.length * 2)

    # 区間[l, r)の値とxをfnで比較して更新する
    def update(self, l, r, x):  # O(logN)
        l += self.length
        r += self.length
        while l < r:
            if l & 1:
                self.data[l] = self.fn(self.data[l], x)
                l += 1
            if r & 1:
                self.data[r - 1] = self.fn(self.data[r - 1], x)
                r -= 1
            l //= 2
            r //= 2

    # i番目の要素の値を取得する
    def query(self, i):  # O(logN)
        i += len(self.data) // 2
        ret = self.data[i]
        while i > 0:
            i //= 2
            ret = self.fn(ret, self.data[i])
        return ret class SegmentTree(object):

    def __init__(self, n, e, fn):
        self.fn = fn
        self.length = 1 << n.bit_length()
        self.data = [e] * (self.length * 2)

    # 区間[l, r)の値とxをfnで比較して更新する
    def update(self, l, r, x):  # O(logN)
        l += self.length
        r += self.length
        while l < r:
            if l & 1:
                self.data[l] = self.fn(self.data[l], x)
                l += 1
            if r & 1:
                self.data[r - 1] = self.fn(self.data[r - 1], x)
                r -= 1
            l //= 2
            r //= 2

    # i番目の要素の値を取得する
    def query(self, i):  # O(logN)
        i += len(self.data) // 2
        ret = self.data[i]
        while i > 0:
            i //= 2
            ret = self.fn(ret, self.data[i])
        return ret SegmentTree def LMI(): return list(map(int, sys.stdin.readline().split())) def LMI(): return list(map(int, sys.stdin.readline().split())) LMI
import sys
sys.setrecursionlimit(300000)
from bisect import bisect_left

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


# 区間updateと要素クエリ
class SegmentTree(object):

    def __init__(self, n, e, fn):
        self.fn = fn
        self.length = 1 << n.bit_length()
        self.data = [e] * (self.length * 2)

    # 区間[l, r)の値とxをfnで比較して更新する
    def update(self, l, r, x):  # O(logN)
        l += self.length
        r += self.length
        while l < r:
            if l & 1:
                self.data[l] = self.fn(self.data[l], x)
                l += 1
            if r & 1:
                self.data[r - 1] = self.fn(self.data[r - 1], x)
                r -= 1
            l //= 2
            r //= 2

    # i番目の要素の値を取得する
    def query(self, i):  # O(logN)
        i += len(self.data) // 2
        ret = self.data[i]
        while i > 0:
            i //= 2
            ret = self.fn(ret, self.data[i])
        return ret

N, Q = MI()
STX = [tuple(MI()) for _ in range(N)]
D = [I() for _ in range(Q)]

seg = SegmentTree(Q, INF, min)
for S, T, X in STX:
    # [S - X, T - X) に出発する人[l番目の人, r番目の人)が影響を受ける
    l = bisect_left(D, S - X)
    r = bisect_left(D, T - X)
    seg.update(l, r, X)

for i in range(Q):
    ans = seg.query(i)
    if ans == INF:
        print(-1)
    else:
        print(ans)