class SegmentTree :
    def __init__(self, n) :
        self.n = n
        self.N0 = 1 << n.bit_length()
        self.data = [10**15] * (self.N0*2)
 
    def update(self, l, r, val) :
        l += self.N0
        r += self.N0
        while l < r:
            if l & 1 :
                self.data[l] = min(self.data[l], val)
                l += 1
            if r & 1:
                self.data[r-1] = min(self.data[r-1], val)
                r -= 1
            l //= 2
            r //= 2
 
    def query(self, i) :
        i += len(self.data) // 2
        ret = self.data[i]
        while i > 0 :
            i //= 2
            ret = min(ret, self.data[i])
        return ret if ret < 10**15 else -1
import bisect
import sys
input = sys.stdin.readline
N, Q = map(int, input().split())
roads = []
for _ in range(N):
    s, t, x = map(int, input().split())
    roads.append((x, s, t))
compress_list = []
query = []
for _ in range(Q):
    d = int(input())
    compress_list.append(d)
S = SegmentTree(Q)
for x, s, t in roads:
    l = bisect.bisect_left(compress_list, s-x)
    r = bisect.bisect_left(compress_list, t-x)
    S.update(l, r, x)
for i in range(Q):
    print(S.query(i))    class SegmentTree :
    def __init__(self, n) :
        self.n = n
        self.N0 = 1 << n.bit_length()
        self.data = [10**15] * (self.N0*2)
 
    def update(self, l, r, val) :
        l += self.N0
        r += self.N0
        while l < r:
            if l & 1 :
                self.data[l] = min(self.data[l], val)
                l += 1
            if r & 1:
                self.data[r-1] = min(self.data[r-1], val)
                r -= 1
            l //= 2
            r //= 2
 
    def query(self, i) :
        i += len(self.data) // 2
        ret = self.data[i]
        while i > 0 :
            i //= 2
            ret = min(ret, self.data[i])
        return ret if ret < 10**15 else -1 SegmentTree def __init__(self, n) :
        self.n = n
        self.N0 = 1 << n.bit_length()
        self.data = [10**15] * (self.N0*2)
 
     __init__ self.n = n self.n self n n self.N0 = 1 << n.bit_length() self.N0 self N0 1 << n.bit_length() 1 n.bit_length() n.bit_length n bit_length self.data = [10**15] * (self.N0*2) self.data self data [10**15] * (self.N0*2) [10**15] 10**15 10 15 self.N0*2 self.N0 self N0 2 self self n n def update(self, l, r, val) :
        l += self.N0
        r += self.N0
        while l < r:
            if l & 1 :
                self.data[l] = min(self.data[l], val)
                l += 1
            if r & 1:
                self.data[r-1] = min(self.data[r-1], val)
                r -= 1
            l //= 2
            r //= 2
 
     update l += self.N0 l self.N0 self N0 r += self.N0 r self.N0 self N0 while l < r:
            if l & 1 :
                self.data[l] = min(self.data[l], val)
                l += 1
            if r & 1:
                self.data[r-1] = min(self.data[r-1], val)
                r -= 1
            l //= 2
            r //= 2
 
     l < r l r if l & 1 :
                self.data[l] = min(self.data[l], val)
                l += 1
             l & 1 l 1 self.data[l] = min(self.data[l], val) self.data[l] self.data self data l min(self.data[l], val) min self.data[l] self.data self data l val l += 1 l 1 if r & 1:
                self.data[r-1] = min(self.data[r-1], val)
                r -= 1
             r & 1 r 1 self.data[r-1] = min(self.data[r-1], val) self.data[r-1] self.data self data r-1 r 1 min(self.data[r-1], val) min self.data[r-1] self.data self data r-1 r 1 val r -= 1 r 1 l //= 2 l 2 r //= 2 r 2 self self l l r r val val def query(self, i) :
        i += len(self.data) // 2
        ret = self.data[i]
        while i > 0 :
            i //= 2
            ret = min(ret, self.data[i])
        return ret if ret < 10**15 else -1 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 = min(ret, self.data[i])
         i > 0 i 0 i //= 2 i 2 ret = min(ret, self.data[i]) ret min(ret, self.data[i]) min ret self.data[i] self.data self data i return ret if ret < 10**15 else -1 ret if ret < 10**15 else -1 ret < 10**15 ret 10**15 10 15 ret -1 self self i i import bisect bisect import sys sys 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 roads = [] roads [] for _ in range(N):
    s, t, x = map(int, input().split())
    roads.append((x, s, t)) _ 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 roads.append((x, s, t)) roads.append roads append (x, s, t) x s t compress_list = [] compress_list [] query = [] query [] for _ in range(Q):
    d = int(input())
    compress_list.append(d) _ range(Q) range Q d = int(input()) d int(input()) int input() input compress_list.append(d) compress_list.append compress_list append d S = SegmentTree(Q) S SegmentTree(Q) SegmentTree Q for x, s, t in roads:
    l = bisect.bisect_left(compress_list, s-x)
    r = bisect.bisect_left(compress_list, t-x)
    S.update(l, r, x) x s t roads l = bisect.bisect_left(compress_list, s-x) l bisect.bisect_left(compress_list, s-x) bisect.bisect_left bisect bisect_left compress_list s-x s x r = bisect.bisect_left(compress_list, t-x) r bisect.bisect_left(compress_list, t-x) bisect.bisect_left bisect bisect_left compress_list t-x t x S.update(l, r, x) S.update S update l r x for i in range(Q):
    print(S.query(i))    i range(Q) range Q print(S.query(i)) print S.query(i) S.query S query i d = int(input()) int(input()) d roads = [] [] roads s, t, x = map(int, input().split()) map(int, input().split()) s compress_list = [] [] compress_list input = sys.stdin.readline sys.stdin.readline input Q = map(int, input().split()) map(int, input().split()) Q query = [] [] query x = map(int, input().split()) map(int, input().split()) x l = bisect.bisect_left(compress_list, s-x) bisect.bisect_left(compress_list, s-x) l r = bisect.bisect_left(compress_list, t-x) bisect.bisect_left(compress_list, t-x) r t, x = map(int, input().split()) map(int, input().split()) t N, Q = map(int, input().split()) map(int, input().split()) N S = SegmentTree(Q) SegmentTree(Q) S class SegmentTree :
    def __init__(self, n) :
        self.n = n
        self.N0 = 1 << n.bit_length()
        self.data = [10**15] * (self.N0*2)
 
    def update(self, l, r, val) :
        l += self.N0
        r += self.N0
        while l < r:
            if l & 1 :
                self.data[l] = min(self.data[l], val)
                l += 1
            if r & 1:
                self.data[r-1] = min(self.data[r-1], val)
                r -= 1
            l //= 2
            r //= 2
 
    def query(self, i) :
        i += len(self.data) // 2
        ret = self.data[i]
        while i > 0 :
            i //= 2
            ret = min(ret, self.data[i])
        return ret if ret < 10**15 else -1 class SegmentTree :
    def __init__(self, n) :
        self.n = n
        self.N0 = 1 << n.bit_length()
        self.data = [10**15] * (self.N0*2)
 
    def update(self, l, r, val) :
        l += self.N0
        r += self.N0
        while l < r:
            if l & 1 :
                self.data[l] = min(self.data[l], val)
                l += 1
            if r & 1:
                self.data[r-1] = min(self.data[r-1], val)
                r -= 1
            l //= 2
            r //= 2
 
    def query(self, i) :
        i += len(self.data) // 2
        ret = self.data[i]
        while i > 0 :
            i //= 2
            ret = min(ret, self.data[i])
        return ret if ret < 10**15 else -1 SegmentTree
class SegmentTree :
    def __init__(self, n) :
        self.n = n
        self.N0 = 1 << n.bit_length()
        self.data = [10**15] * (self.N0*2)
 
    def update(self, l, r, val) :
        l += self.N0
        r += self.N0
        while l < r:
            if l & 1 :
                self.data[l] = min(self.data[l], val)
                l += 1
            if r & 1:
                self.data[r-1] = min(self.data[r-1], val)
                r -= 1
            l //= 2
            r //= 2
 
    def query(self, i) :
        i += len(self.data) // 2
        ret = self.data[i]
        while i > 0 :
            i //= 2
            ret = min(ret, self.data[i])
        return ret if ret < 10**15 else -1
import bisect
import sys
input = sys.stdin.readline
N, Q = map(int, input().split())
roads = []
for _ in range(N):
    s, t, x = map(int, input().split())
    roads.append((x, s, t))
compress_list = []
query = []
for _ in range(Q):
    d = int(input())
    compress_list.append(d)
S = SegmentTree(Q)
for x, s, t in roads:
    l = bisect.bisect_left(compress_list, s-x)
    r = bisect.bisect_left(compress_list, t-x)
    S.update(l, r, x)
for i in range(Q):
    print(S.query(i))   