import sys
input = sys.stdin.readline

class RangeUpdateQuery:
    def __init__(self, n):
        self.n0 = 2**(n-1).bit_length()
        self.INF = float("inf")
        self.data = [self.INF]*(2*self.n0-1)

    def update(self, l,r,v):
        l += self.n0
        r += self.n0
        while l < r:
            if r&1:
                r -= 1
                self.data[r-1] = v
            if l&1:
                self.data[l-1] = v
                l += 1
            l >>=1
            r >>=1

    def query(self, i):
        i += self.n0-1
        res = self.INF
        while i+1:
            if self.data[i] < res:
                res = self.data[i]
            i = ~-i//2
        return res

n,q = map(int, input().split())
start = [None]*q
se = set()

road = []
for i in range(n):
    s,t,x = map(int, input().split())
    road.append([x, x-t, x-s])
for i in range(q):
    d = int(input())
    start[i] = -d

start = start[::-1]

RUQ = RangeUpdateQuery(q)
road.sort(reverse=True)
from bisect import bisect_left,bisect_right
for i, (x, s, t) in enumerate(road):
    l = bisect_right(start, s)
    r = bisect_right(start, t)
    #print(x, (s,t), l, r)
    RUQ.update(l, r, x)

ans = []
for i in range(q):
    x = RUQ.query(i)
    if x == float("inf"):
        x = -1
    ans.append(x)
ans = ans[::-1]
print(*ans, sep="\n") import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline class RangeUpdateQuery:
    def __init__(self, n):
        self.n0 = 2**(n-1).bit_length()
        self.INF = float("inf")
        self.data = [self.INF]*(2*self.n0-1)

    def update(self, l,r,v):
        l += self.n0
        r += self.n0
        while l < r:
            if r&1:
                r -= 1
                self.data[r-1] = v
            if l&1:
                self.data[l-1] = v
                l += 1
            l >>=1
            r >>=1

    def query(self, i):
        i += self.n0-1
        res = self.INF
        while i+1:
            if self.data[i] < res:
                res = self.data[i]
            i = ~-i//2
        return res RangeUpdateQuery def __init__(self, n):
        self.n0 = 2**(n-1).bit_length()
        self.INF = float("inf")
        self.data = [self.INF]*(2*self.n0-1)

     __init__ self.n0 = 2**(n-1).bit_length() self.n0 self n0 2**(n-1).bit_length() 2 (n-1).bit_length() n-1).bit_length n-1 n 1 bit_length self.INF = float("inf") self.INF self INF float("inf") float "inf" self.data = [self.INF]*(2*self.n0-1) self.data self data [self.INF]*(2*self.n0-1) [self.INF] self.INF self INF 2*self.n0-1 2*self.n0 2 self.n0 self n0 1 self self n n def update(self, l,r,v):
        l += self.n0
        r += self.n0
        while l < r:
            if r&1:
                r -= 1
                self.data[r-1] = v
            if l&1:
                self.data[l-1] = v
                l += 1
            l >>=1
            r >>=1

     update l += self.n0 l self.n0 self n0 r += self.n0 r self.n0 self n0 while l < r:
            if r&1:
                r -= 1
                self.data[r-1] = v
            if l&1:
                self.data[l-1] = v
                l += 1
            l >>=1
            r >>=1

     l < r l r if r&1:
                r -= 1
                self.data[r-1] = v
             r&1 r 1 r -= 1 r 1 self.data[r-1] = v self.data[r-1] self.data self data r-1 r 1 v if l&1:
                self.data[l-1] = v
                l += 1
             l&1 l 1 self.data[l-1] = v self.data[l-1] self.data self data l-1 l 1 v l += 1 l 1 l >>=1 l 1 r >>=1 r 1 self self l l r r v v def query(self, i):
        i += self.n0-1
        res = self.INF
        while i+1:
            if self.data[i] < res:
                res = self.data[i]
            i = ~-i//2
        return res query i += self.n0-1 i self.n0-1 self.n0 self n0 1 res = self.INF res self.INF self INF while i+1:
            if self.data[i] < res:
                res = self.data[i]
            i = ~-i//2
         i+1 i 1 if self.data[i] < res:
                res = self.data[i]
             self.data[i] < res self.data[i] self.data self data i res res = self.data[i] res self.data[i] self.data self data i i = ~-i//2 i ~-i//2 ~-i -i i 2 return res res self self i i n,q = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split q start = [None]*q start [None]*q [None] None q se = set() se set() set road = [] road [] for i in range(n):
    s,t,x = map(int, input().split())
    road.append([x, x-t, x-s]) 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 road.append([x, x-t, x-s]) road.append road append [x, x-t, x-s] x x-t x t x-s x s for i in range(q):
    d = int(input())
    start[i] = -d i range(q) range q d = int(input()) d int(input()) int input() input start[i] = -d start[i] start i -d d start = start[::-1] start start[::-1] start ::-1 -1 RUQ = RangeUpdateQuery(q) RUQ RangeUpdateQuery(q) RangeUpdateQuery q road.sort(reverse=True) road.sort road sort reverse=True reverse True from bisect import bisect_left,bisect_right for i, (x, s, t) in enumerate(road):
    l = bisect_right(start, s)
    r = bisect_right(start, t)
    #print(x, (s,t), l, r)
    RUQ.update(l, r, x) i (x, s, t) x s t enumerate(road) enumerate road l = bisect_right(start, s) l bisect_right(start, s) bisect_right start s r = bisect_right(start, t) r bisect_right(start, t) bisect_right start t RUQ.update(l, r, x) RUQ.update RUQ update l r x ans = [] ans [] for i in range(q):
    x = RUQ.query(i)
    if x == float("inf"):
        x = -1
    ans.append(x) i range(q) range q x = RUQ.query(i) x RUQ.query(i) RUQ.query RUQ query i if x == float("inf"):
        x = -1
     x == float("inf") x float("inf") float "inf" x = -1 x -1 ans.append(x) ans.append ans append x ans = ans[::-1] ans ans[::-1] ans ::-1 -1 print(*ans, sep="\n") print *ans ans sep="\n" sep "\n" start = [None]*q [None]*q start road = [] [] road r = bisect_right(start, t) bisect_right(start, t) r x = -1 -1 x s,t,x = map(int, input().split()) map(int, input().split()) s d = int(input()) int(input()) d x = map(int, input().split()) map(int, input().split()) x q = map(int, input().split()) map(int, input().split()) q l = bisect_right(start, s) bisect_right(start, s) l ans = ans[::-1] ans[::-1] ans t,x = map(int, input().split()) map(int, input().split()) t start = start[::-1] start[::-1] start n,q = map(int, input().split()) map(int, input().split()) n input = sys.stdin.readline sys.stdin.readline input class RangeUpdateQuery:
    def __init__(self, n):
        self.n0 = 2**(n-1).bit_length()
        self.INF = float("inf")
        self.data = [self.INF]*(2*self.n0-1)

    def update(self, l,r,v):
        l += self.n0
        r += self.n0
        while l < r:
            if r&1:
                r -= 1
                self.data[r-1] = v
            if l&1:
                self.data[l-1] = v
                l += 1
            l >>=1
            r >>=1

    def query(self, i):
        i += self.n0-1
        res = self.INF
        while i+1:
            if self.data[i] < res:
                res = self.data[i]
            i = ~-i//2
        return res class RangeUpdateQuery:
    def __init__(self, n):
        self.n0 = 2**(n-1).bit_length()
        self.INF = float("inf")
        self.data = [self.INF]*(2*self.n0-1)

    def update(self, l,r,v):
        l += self.n0
        r += self.n0
        while l < r:
            if r&1:
                r -= 1
                self.data[r-1] = v
            if l&1:
                self.data[l-1] = v
                l += 1
            l >>=1
            r >>=1

    def query(self, i):
        i += self.n0-1
        res = self.INF
        while i+1:
            if self.data[i] < res:
                res = self.data[i]
            i = ~-i//2
        return res RangeUpdateQuery se = set() set() se RUQ = RangeUpdateQuery(q) RangeUpdateQuery(q) RUQ ans = [] [] ans x = RUQ.query(i) RUQ.query(i) x
import sys
input = sys.stdin.readline

class RangeUpdateQuery:
    def __init__(self, n):
        self.n0 = 2**(n-1).bit_length()
        self.INF = float("inf")
        self.data = [self.INF]*(2*self.n0-1)

    def update(self, l,r,v):
        l += self.n0
        r += self.n0
        while l < r:
            if r&1:
                r -= 1
                self.data[r-1] = v
            if l&1:
                self.data[l-1] = v
                l += 1
            l >>=1
            r >>=1

    def query(self, i):
        i += self.n0-1
        res = self.INF
        while i+1:
            if self.data[i] < res:
                res = self.data[i]
            i = ~-i//2
        return res

n,q = map(int, input().split())
start = [None]*q
se = set()

road = []
for i in range(n):
    s,t,x = map(int, input().split())
    road.append([x, x-t, x-s])
for i in range(q):
    d = int(input())
    start[i] = -d

start = start[::-1]

RUQ = RangeUpdateQuery(q)
road.sort(reverse=True)
from bisect import bisect_left,bisect_right
for i, (x, s, t) in enumerate(road):
    l = bisect_right(start, s)
    r = bisect_right(start, t)
    #print(x, (s,t), l, r)
    RUQ.update(l, r, x)

ans = []
for i in range(q):
    x = RUQ.query(i)
    if x == float("inf"):
        x = -1
    ans.append(x)
ans = ans[::-1]
print(*ans, sep="\n")