import sys
input = sys.stdin.readline
from bisect import bisect_left

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())
chk = []
for i in range(n):
  s,t,x = map(int,input().split())
  chk.append((s-x,t-x,x))
  
d = [int(input()) for i in range(q)]
seg = SegmentTree(q,10**9+1,lambda a, b: min(a,b))

for a,b,x in chk:
  L = bisect_left(d,a)
  R = bisect_left(d,b)
  seg.update(L,R,x)
  
for i in range(q):
  m = seg.query(i)
  if m == 10**9+1:
    print(-1)
  else:
    print(m) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline from bisect import bisect_left 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 chk = [] chk [] for i in range(n):
  s,t,x = map(int,input().split())
  chk.append((s-x,t-x,x))
   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 chk.append((s-x,t-x,x)) chk.append chk append (s-x,t-x,x) s-x s x t-x t x x int(input()) for i in range(q) for i in range(q) i range(q) range q for i in range(q) int(input()) int input() input d = [int(input()) for i in range(q)] d [int(input()) for i in range(q)] seg = SegmentTree(q,10**9+1,lambda a, b: min(a,b)) seg SegmentTree(q,10**9+1,lambda a, b: min(a,b)) SegmentTree q 10**9+1 10**9 10 9 1 lambda a, b: min(a,b) min(a,b) min a b a b for a,b,x in chk:
  L = bisect_left(d,a)
  R = bisect_left(d,b)
  seg.update(L,R,x)
   a b x chk L = bisect_left(d,a) L bisect_left(d,a) bisect_left d a R = bisect_left(d,b) R bisect_left(d,b) bisect_left d b seg.update(L,R,x) seg.update seg update L R x for i in range(q):
  m = seg.query(i)
  if m == 10**9+1:
    print(-1)
  else:
    print(m) i range(q) range q m = seg.query(i) m seg.query(i) seg.query seg query i if m == 10**9+1:
    print(-1)
  else:
    print(m) m == 10**9+1 m 10**9+1 10**9 10 9 1 print(-1) print -1 print(m) print m t,x = map(int,input().split()) map(int,input().split()) t input = sys.stdin.readline sys.stdin.readline input R = bisect_left(d,b) bisect_left(d,b) R s,t,x = map(int,input().split()) map(int,input().split()) s d = [int(input()) for i in range(q)] [int(input()) for i in range(q)] d m = seg.query(i) seg.query(i) m x = map(int,input().split()) map(int,input().split()) x chk = [] [] chk seg = SegmentTree(q,10**9+1,lambda a, b: min(a,b)) SegmentTree(q,10**9+1,lambda a, b: min(a,b)) seg q = map(int,input().split()) map(int,input().split()) q 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 n,q = map(int,input().split()) map(int,input().split()) n L = bisect_left(d,a) bisect_left(d,a) L
import sys
input = sys.stdin.readline
from bisect import bisect_left

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())
chk = []
for i in range(n):
  s,t,x = map(int,input().split())
  chk.append((s-x,t-x,x))
  
d = [int(input()) for i in range(q)]
seg = SegmentTree(q,10**9+1,lambda a, b: min(a,b))

for a,b,x in chk:
  L = bisect_left(d,a)
  R = bisect_left(d,b)
  seg.update(L,R,x)
  
for i in range(q):
  m = seg.query(i)
  if m == 10**9+1:
    print(-1)
  else:
    print(m)