import sys
input = lambda : sys.stdin.readline().rstrip()

def segfun(x, y):
    return min(x, y)
ide_ele = 10**9 + 1


class SegmentTree:
    def __init__(self, n, ele, segfun):
        self.ide_ele = ele
        self.segfun = segfun
        self.n = n
        self.N0 = 1 << n.bit_length()
        self.data = [self.ide_ele] * (self.N0 * 2)
 
    def update(self, l, r, val):
        l += self.N0
        r += self.N0
        while l < r:
            if l & 1:
                self.data[l] = self.segfun(self.data[l], val)
                l += 1
            if r & 1:
                self.data[r - 1] = self.segfun(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 = self.segfun(ret, self.data[i])
        return ret


n, q = map(int, input().split())
stx = []
for _ in range(n):
    s, t, x = map(int, input().split())
    stx.append([x, s - x, t - x])
# stx.sort(reverse=True)
d = [int(input()) for _ in range(q)]

import bisect

seg = SegmentTree(q, ide_ele, segfun)

for x, start, last in stx:
    l = bisect.bisect_left(d, start)
    r = bisect.bisect_left(d, last)
    seg.update(l, r, x)

for i, j in enumerate(d):
    res = seg.query(i)
    if res == ide_ele:
        print(-1)
    else:
        print(res)
    
 import sys sys input = lambda : sys.stdin.readline().rstrip() input lambda : sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def segfun(x, y):
    return min(x, y) segfun return min(x, y) min(x, y) min x y x x y y ide_ele = 10**9 + 1 ide_ele 10**9 + 1 10**9 10 9 1 class SegmentTree:
    def __init__(self, n, ele, segfun):
        self.ide_ele = ele
        self.segfun = segfun
        self.n = n
        self.N0 = 1 << n.bit_length()
        self.data = [self.ide_ele] * (self.N0 * 2)
 
    def update(self, l, r, val):
        l += self.N0
        r += self.N0
        while l < r:
            if l & 1:
                self.data[l] = self.segfun(self.data[l], val)
                l += 1
            if r & 1:
                self.data[r - 1] = self.segfun(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 = self.segfun(ret, self.data[i])
        return ret SegmentTree def __init__(self, n, ele, segfun):
        self.ide_ele = ele
        self.segfun = segfun
        self.n = n
        self.N0 = 1 << n.bit_length()
        self.data = [self.ide_ele] * (self.N0 * 2)
 
     __init__ self.ide_ele = ele self.ide_ele self ide_ele ele self.segfun = segfun self.segfun self segfun segfun 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 = [self.ide_ele] * (self.N0 * 2) self.data self data [self.ide_ele] * (self.N0 * 2) [self.ide_ele] self.ide_ele self ide_ele self.N0 * 2 self.N0 self N0 2 self self n n ele ele segfun segfun def update(self, l, r, val):
        l += self.N0
        r += self.N0
        while l < r:
            if l & 1:
                self.data[l] = self.segfun(self.data[l], val)
                l += 1
            if r & 1:
                self.data[r - 1] = self.segfun(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] = self.segfun(self.data[l], val)
                l += 1
            if r & 1:
                self.data[r - 1] = self.segfun(self.data[r - 1], val)
                r -= 1
            l //= 2
            r //= 2
 
     l < r l r if l & 1:
                self.data[l] = self.segfun(self.data[l], val)
                l += 1
             l & 1 l 1 self.data[l] = self.segfun(self.data[l], val) self.data[l] self.data self data l self.segfun(self.data[l], val) self.segfun self segfun self.data[l] self.data self data l val l += 1 l 1 if r & 1:
                self.data[r - 1] = self.segfun(self.data[r - 1], val)
                r -= 1
             r & 1 r 1 self.data[r - 1] = self.segfun(self.data[r - 1], val) self.data[r - 1] self.data self data r - 1 r 1 self.segfun(self.data[r - 1], val) self.segfun self segfun 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 = self.segfun(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.segfun(ret, self.data[i])
         i > 0 i 0 i //= 2 i 2 ret = self.segfun(ret, self.data[i]) ret self.segfun(ret, self.data[i]) self.segfun self segfun ret self.data[i] self.data self data i return ret ret self self i i n, q = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split q stx = [] stx [] for _ in range(n):
    s, t, x = map(int, input().split())
    stx.append([x, s - x, t - x])
# stx.sort(reverse=True) _ 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([x, s - x, t - x]) stx.append stx append [x, s - x, t - x] x s - x s x t - x t x int(input()) for _ in range(q) for _ in range(q) _ range(q) range q for _ in range(q) int(input()) int input() input d = [int(input()) for _ in range(q)] d [int(input()) for _ in range(q)] import bisect bisect seg = SegmentTree(q, ide_ele, segfun) seg SegmentTree(q, ide_ele, segfun) SegmentTree q ide_ele segfun for x, start, last in stx:
    l = bisect.bisect_left(d, start)
    r = bisect.bisect_left(d, last)
    seg.update(l, r, x) x start last stx l = bisect.bisect_left(d, start) l bisect.bisect_left(d, start) bisect.bisect_left bisect bisect_left d start r = bisect.bisect_left(d, last) r bisect.bisect_left(d, last) bisect.bisect_left bisect bisect_left d last seg.update(l, r, x) seg.update seg update l r x for i, j in enumerate(d):
    res = seg.query(i)
    if res == ide_ele:
        print(-1)
    else:
        print(res)
     i j enumerate(d) enumerate d res = seg.query(i) res seg.query(i) seg.query seg query i if res == ide_ele:
        print(-1)
    else:
        print(res)
     res == ide_ele res ide_ele print(-1) print -1 print(res) print res input = lambda : sys.stdin.readline().rstrip() lambda : sys.stdin.readline().rstrip() input ide_ele = 10**9 + 1 10**9 + 1 ide_ele d = [int(input()) for _ in range(q)] [int(input()) for _ in range(q)] d l = bisect.bisect_left(d, start) bisect.bisect_left(d, start) l stx = [] [] stx seg = SegmentTree(q, ide_ele, segfun) SegmentTree(q, ide_ele, segfun) seg s, t, x = map(int, input().split()) map(int, input().split()) s n, q = map(int, input().split()) map(int, input().split()) n def segfun(x, y):
    return min(x, y) def segfun(x, y):
    return min(x, y) segfun x = map(int, input().split()) map(int, input().split()) x class SegmentTree:
    def __init__(self, n, ele, segfun):
        self.ide_ele = ele
        self.segfun = segfun
        self.n = n
        self.N0 = 1 << n.bit_length()
        self.data = [self.ide_ele] * (self.N0 * 2)
 
    def update(self, l, r, val):
        l += self.N0
        r += self.N0
        while l < r:
            if l & 1:
                self.data[l] = self.segfun(self.data[l], val)
                l += 1
            if r & 1:
                self.data[r - 1] = self.segfun(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 = self.segfun(ret, self.data[i])
        return ret class SegmentTree:
    def __init__(self, n, ele, segfun):
        self.ide_ele = ele
        self.segfun = segfun
        self.n = n
        self.N0 = 1 << n.bit_length()
        self.data = [self.ide_ele] * (self.N0 * 2)
 
    def update(self, l, r, val):
        l += self.N0
        r += self.N0
        while l < r:
            if l & 1:
                self.data[l] = self.segfun(self.data[l], val)
                l += 1
            if r & 1:
                self.data[r - 1] = self.segfun(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 = self.segfun(ret, self.data[i])
        return ret SegmentTree r = bisect.bisect_left(d, last) bisect.bisect_left(d, last) r q = map(int, input().split()) map(int, input().split()) q t, x = map(int, input().split()) map(int, input().split()) t res = seg.query(i) seg.query(i) res
import sys
input = lambda : sys.stdin.readline().rstrip()

def segfun(x, y):
    return min(x, y)
ide_ele = 10**9 + 1


class SegmentTree:
    def __init__(self, n, ele, segfun):
        self.ide_ele = ele
        self.segfun = segfun
        self.n = n
        self.N0 = 1 << n.bit_length()
        self.data = [self.ide_ele] * (self.N0 * 2)
 
    def update(self, l, r, val):
        l += self.N0
        r += self.N0
        while l < r:
            if l & 1:
                self.data[l] = self.segfun(self.data[l], val)
                l += 1
            if r & 1:
                self.data[r - 1] = self.segfun(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 = self.segfun(ret, self.data[i])
        return ret


n, q = map(int, input().split())
stx = []
for _ in range(n):
    s, t, x = map(int, input().split())
    stx.append([x, s - x, t - x])
# stx.sort(reverse=True)
d = [int(input()) for _ in range(q)]

import bisect

seg = SegmentTree(q, ide_ele, segfun)

for x, start, last in stx:
    l = bisect.bisect_left(d, start)
    r = bisect.bisect_left(d, last)
    seg.update(l, r, x)

for i, j in enumerate(d):
    res = seg.query(i)
    if res == ide_ele:
        print(-1)
    else:
        print(res)
    

