import sys
input = sys.stdin.readline
from bisect import bisect_left as bl
class segtree:
    def __init__(self, nn):
        self.NN = nn
        self.XX = [0] * (2**(nn+1)-1)
    def getmax(self, i):
        j = 2**self.NN + i - 1
        ma = -1
        while j >= 0:
            ma = max(ma, self.XX[j])
            j = (j-1) // 2
        return -1 if ma <= 0 else INF - ma
    def updaterange(self, a, b, x):
        l = a + (1<<self.NN)
        r = b + (1<<self.NN)
        s = 0
        while l < r:
            if l%2:
                self.XX[l-1] = max(self.XX[l-1], x)
                l += 1
            if r%2:
                r -= 1
                self.XX[r-1] = max(self.XX[r-1], x)
            l >>= 1
            r >>= 1

N, Q = map(int, input().split())
st = segtree(18)
INF = 1<<50
X = []
D = []
for _ in range(N):
    s, t, x = map(int, input().split())
    X.append((s, t, x))
for _ in range(Q):
    D.append(int(input()))

for s, t, x in X:
    st.updaterange(bl(D, s-x), bl(D, t-x), INF-x)
for i in range(Q):
    print(st.getmax(i)) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline from bisect import bisect_left as bl class segtree:
    def __init__(self, nn):
        self.NN = nn
        self.XX = [0] * (2**(nn+1)-1)
    def getmax(self, i):
        j = 2**self.NN + i - 1
        ma = -1
        while j >= 0:
            ma = max(ma, self.XX[j])
            j = (j-1) // 2
        return -1 if ma <= 0 else INF - ma
    def updaterange(self, a, b, x):
        l = a + (1<<self.NN)
        r = b + (1<<self.NN)
        s = 0
        while l < r:
            if l%2:
                self.XX[l-1] = max(self.XX[l-1], x)
                l += 1
            if r%2:
                r -= 1
                self.XX[r-1] = max(self.XX[r-1], x)
            l >>= 1
            r >>= 1 segtree def __init__(self, nn):
        self.NN = nn
        self.XX = [0] * (2**(nn+1)-1)
     __init__ self.NN = nn self.NN self NN nn self.XX = [0] * (2**(nn+1)-1) self.XX self XX [0] * (2**(nn+1)-1) [0] 0 2**(nn+1)-1 2**(nn+1) 2 nn+1 nn 1 1 self self nn nn def getmax(self, i):
        j = 2**self.NN + i - 1
        ma = -1
        while j >= 0:
            ma = max(ma, self.XX[j])
            j = (j-1) // 2
        return -1 if ma <= 0 else INF - ma
     getmax j = 2**self.NN + i - 1 j 2**self.NN + i - 1 2**self.NN + i 2**self.NN 2 self.NN self NN i 1 ma = -1 ma -1 while j >= 0:
            ma = max(ma, self.XX[j])
            j = (j-1) // 2
         j >= 0 j 0 ma = max(ma, self.XX[j]) ma max(ma, self.XX[j]) max ma self.XX[j] self.XX self XX j j = (j-1) // 2 j (j-1) // 2 j-1 j 1 2 return -1 if ma <= 0 else INF - ma -1 if ma <= 0 else INF - ma ma <= 0 ma 0 -1 INF - ma INF ma self self i i def updaterange(self, a, b, x):
        l = a + (1<<self.NN)
        r = b + (1<<self.NN)
        s = 0
        while l < r:
            if l%2:
                self.XX[l-1] = max(self.XX[l-1], x)
                l += 1
            if r%2:
                r -= 1
                self.XX[r-1] = max(self.XX[r-1], x)
            l >>= 1
            r >>= 1 updaterange l = a + (1<<self.NN) l a + (1<<self.NN) a 1<<self.NN 1 self.NN self NN r = b + (1<<self.NN) r b + (1<<self.NN) b 1<<self.NN 1 self.NN self NN s = 0 s 0 while l < r:
            if l%2:
                self.XX[l-1] = max(self.XX[l-1], x)
                l += 1
            if r%2:
                r -= 1
                self.XX[r-1] = max(self.XX[r-1], x)
            l >>= 1
            r >>= 1 l < r l r if l%2:
                self.XX[l-1] = max(self.XX[l-1], x)
                l += 1
             l%2 l 2 self.XX[l-1] = max(self.XX[l-1], x) self.XX[l-1] self.XX self XX l-1 l 1 max(self.XX[l-1], x) max self.XX[l-1] self.XX self XX l-1 l 1 x l += 1 l 1 if r%2:
                r -= 1
                self.XX[r-1] = max(self.XX[r-1], x)
             r%2 r 2 r -= 1 r 1 self.XX[r-1] = max(self.XX[r-1], x) self.XX[r-1] self.XX self XX r-1 r 1 max(self.XX[r-1], x) max self.XX[r-1] self.XX self XX r-1 r 1 x l >>= 1 l 1 r >>= 1 r 1 self self a a b b x x N, Q = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split Q st = segtree(18) st segtree(18) segtree 18 INF = 1<<50 INF 1<<50 1 50 X = [] X [] D = [] D [] for _ in range(N):
    s, t, x = map(int, input().split())
    X.append((s, t, 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 X.append((s, t, x)) X.append X append (s, t, x) s t x for _ in range(Q):
    D.append(int(input())) _ range(Q) range Q D.append(int(input())) D.append D append int(input()) int input() input for s, t, x in X:
    st.updaterange(bl(D, s-x), bl(D, t-x), INF-x) s t x X st.updaterange(bl(D, s-x), bl(D, t-x), INF-x) st.updaterange st updaterange bl(D, s-x) bl D s-x s x bl(D, t-x) bl D t-x t x INF-x INF x for i in range(Q):
    print(st.getmax(i)) i range(Q) range Q print(st.getmax(i)) print st.getmax(i) st.getmax st getmax i X = [] [] X INF = 1<<50 1<<50 INF t, x = map(int, input().split()) map(int, input().split()) t class segtree:
    def __init__(self, nn):
        self.NN = nn
        self.XX = [0] * (2**(nn+1)-1)
    def getmax(self, i):
        j = 2**self.NN + i - 1
        ma = -1
        while j >= 0:
            ma = max(ma, self.XX[j])
            j = (j-1) // 2
        return -1 if ma <= 0 else INF - ma
    def updaterange(self, a, b, x):
        l = a + (1<<self.NN)
        r = b + (1<<self.NN)
        s = 0
        while l < r:
            if l%2:
                self.XX[l-1] = max(self.XX[l-1], x)
                l += 1
            if r%2:
                r -= 1
                self.XX[r-1] = max(self.XX[r-1], x)
            l >>= 1
            r >>= 1 class segtree:
    def __init__(self, nn):
        self.NN = nn
        self.XX = [0] * (2**(nn+1)-1)
    def getmax(self, i):
        j = 2**self.NN + i - 1
        ma = -1
        while j >= 0:
            ma = max(ma, self.XX[j])
            j = (j-1) // 2
        return -1 if ma <= 0 else INF - ma
    def updaterange(self, a, b, x):
        l = a + (1<<self.NN)
        r = b + (1<<self.NN)
        s = 0
        while l < r:
            if l%2:
                self.XX[l-1] = max(self.XX[l-1], x)
                l += 1
            if r%2:
                r -= 1
                self.XX[r-1] = max(self.XX[r-1], x)
            l >>= 1
            r >>= 1 segtree N, Q = map(int, input().split()) map(int, input().split()) N D = [] [] D s, t, x = map(int, input().split()) map(int, input().split()) s input = sys.stdin.readline sys.stdin.readline input Q = map(int, input().split()) map(int, input().split()) Q st = segtree(18) segtree(18) st x = map(int, input().split()) map(int, input().split()) x
import sys
input = sys.stdin.readline
from bisect import bisect_left as bl
class segtree:
    def __init__(self, nn):
        self.NN = nn
        self.XX = [0] * (2**(nn+1)-1)
    def getmax(self, i):
        j = 2**self.NN + i - 1
        ma = -1
        while j >= 0:
            ma = max(ma, self.XX[j])
            j = (j-1) // 2
        return -1 if ma <= 0 else INF - ma
    def updaterange(self, a, b, x):
        l = a + (1<<self.NN)
        r = b + (1<<self.NN)
        s = 0
        while l < r:
            if l%2:
                self.XX[l-1] = max(self.XX[l-1], x)
                l += 1
            if r%2:
                r -= 1
                self.XX[r-1] = max(self.XX[r-1], x)
            l >>= 1
            r >>= 1

N, Q = map(int, input().split())
st = segtree(18)
INF = 1<<50
X = []
D = []
for _ in range(N):
    s, t, x = map(int, input().split())
    X.append((s, t, x))
for _ in range(Q):
    D.append(int(input()))

for s, t, x in X:
    st.updaterange(bl(D, s-x), bl(D, t-x), INF-x)
for i in range(Q):
    print(st.getmax(i))
