#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    a,p = LI()
    print((a*3+p)//2)
    return

#B
def B():
    n = I()
    s = [None for i in range(n)]
    for i in range(n):
        l = input().split()
        s[i] = l+[i]
    s.sort(key = lambda x:(x[0],-int(x[1])))
    for i,a,b in s:
        print(b+1)
    return

#C
def C():
    def dfs(d,k):
        if d == n:
            l.append(k)
        else:
            dfs(d+1,k+[0])
            dfs(d+1,k+[1])
    n,m = LI()
    l = []
    dfs(0,[])
    qu = LIR(m)
    p = LI()
    ans = 0
    for k in l:
        s = 0
        for q in range(m):
            num = qu[q][0]
            lis = list(map(lambda x:x-1, qu[q][1:]))
            su = 0
            for i in lis:
                su ^= k[i]
            if su == p[q]:
                s += 1
        if s == m:
            ans += 1
    print(ans)
    return

#D
def D():
    n,k = LI()
    v = LI()
    ans = -float("inf")
    for l in range(min(k,n)+1):
        for r in range(min(k,n)-l+1):
            m = 0
            q = v[:l]+v[n-r:]
            q.sort()
            res = max(0,k-r-l)
            for i in range(len(q)):
                if q[i] < 0 and res > 0:
                    res -= 1
                else:
                    m += q[i]
            if m > ans:
                ans = m
    print(ans)
    return

#E
def E():
    n,q = LI()
    a = LIR(n)
    a.sort(key = lambda x : x[2])
    d = IR(q)
    ans = [-1]*(q+1)
    right = [0]*q
    for s,t,x in a:
        l = bisect.bisect_left(d,s-x)
        r = bisect.bisect_left(d,t-x)
        while l < r:
            while ans[l] != -1:
                l = right[l]
            if r <= l:
                break
            ans[l] = x
            right[l] = r
            l += 1
    print(*ans[:-1], sep = "\n")
    return

#F
def F():
    n = I()

    return

#Solve
if __name__ == "__main__":
    E() from collections import defaultdict from collections import deque from heapq import heappush, heappop import sys sys import math math import bisect bisect import random random def LI(): return list(map(int, sys.stdin.readline().split())) LI def I(): return int(sys.stdin.readline()) I def LS():return list(map(list, sys.stdin.readline().split())) LS def S(): return list(sys.stdin.readline())[:-1] S def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l IR None for i in range(n) for i in range(n) i range(n) range n for i in range(n) None l = [None for i in range(n)] l [None for i in range(n)] for i in range(n):l[i] = I()
     i range(n) range n return l l n n def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l LIR None for i in range(n) for i in range(n) i range(n) range n for i in range(n) None l = [None for i in range(n)] l [None for i in range(n)] for i in range(n):l[i] = LI()
     i range(n) range n return l l n n def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l SR None for i in range(n) for i in range(n) i range(n) range n for i in range(n) None l = [None for i in range(n)] l [None for i in range(n)] for i in range(n):l[i] = S()
     i range(n) range n return l l n n def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l LSR None for i in range(n) for i in range(n) i range(n) range n for i in range(n) None l = [None for i in range(n)] l [None for i in range(n)] for i in range(n):l[i] = LS()
     i range(n) range n return l l n n sys.setrecursionlimit(1000000) sys.setrecursionlimit sys setrecursionlimit 1000000 mod = 1000000007 mod 1000000007 def A():
    a,p = LI()
    print((a*3+p)//2)
    return

#B A a,p = LI() a LI() LI p print((a*3+p)//2) print (a*3+p)//2 a*3+p a*3 a 3 p 2 return def B():
    n = I()
    s = [None for i in range(n)]
    for i in range(n):
        l = input().split()
        s[i] = l+[i]
    s.sort(key = lambda x:(x[0],-int(x[1])))
    for i,a,b in s:
        print(b+1)
    return

#C B n = I() n I() I None for i in range(n) for i in range(n) i range(n) range n for i in range(n) None s = [None for i in range(n)] s [None for i in range(n)] for i in range(n):
        l = input().split()
        s[i] = l+[i]
     i range(n) range n l = input().split() l input().split() ().split () input split s[i] = l+[i] s[i] s i l+[i] l [i] i s.sort(key = lambda x:(x[0],-int(x[1]))) s.sort s sort key = lambda x:(x[0],-int(x[1])) key lambda x:(x[0],-int(x[1])) (x[0],-int(x[1])) x[0] x 0 -int(x[1]) int(x[1]) int x[1] x 1 x for i,a,b in s:
        print(b+1)
     i a b s print(b+1) print b+1 b 1 return def C():
    def dfs(d,k):
        if d == n:
            l.append(k)
        else:
            dfs(d+1,k+[0])
            dfs(d+1,k+[1])
    n,m = LI()
    l = []
    dfs(0,[])
    qu = LIR(m)
    p = LI()
    ans = 0
    for k in l:
        s = 0
        for q in range(m):
            num = qu[q][0]
            lis = list(map(lambda x:x-1, qu[q][1:]))
            su = 0
            for i in lis:
                su ^= k[i]
            if su == p[q]:
                s += 1
        if s == m:
            ans += 1
    print(ans)
    return

#D C def dfs(d,k):
        if d == n:
            l.append(k)
        else:
            dfs(d+1,k+[0])
            dfs(d+1,k+[1])
     dfs if d == n:
            l.append(k)
        else:
            dfs(d+1,k+[0])
            dfs(d+1,k+[1])
     d == n d n l.append(k) l.append l append k dfs(d+1,k+[0]) dfs d+1 d 1 k+[0] k [0] 0 dfs(d+1,k+[1]) dfs d+1 d 1 k+[1] k [1] 1 d d k k n,m = LI() n LI() LI m l = [] l [] dfs(0,[]) dfs 0 [] qu = LIR(m) qu LIR(m) LIR m p = LI() p LI() LI ans = 0 ans 0 for k in l:
        s = 0
        for q in range(m):
            num = qu[q][0]
            lis = list(map(lambda x:x-1, qu[q][1:]))
            su = 0
            for i in lis:
                su ^= k[i]
            if su == p[q]:
                s += 1
        if s == m:
            ans += 1
     k l s = 0 s 0 for q in range(m):
            num = qu[q][0]
            lis = list(map(lambda x:x-1, qu[q][1:]))
            su = 0
            for i in lis:
                su ^= k[i]
            if su == p[q]:
                s += 1
         q range(m) range m num = qu[q][0] num qu[q][0] [q] qu q 0 lis = list(map(lambda x:x-1, qu[q][1:])) lis list(map(lambda x:x-1, qu[q][1:])) list map(lambda x:x-1, qu[q][1:]) map lambda x:x-1 x-1 x 1 x qu[q][1:] [q] qu q 1: 1 su = 0 su 0 for i in lis:
                su ^= k[i]
             i lis su ^= k[i] su k[i] k i if su == p[q]:
                s += 1
         su == p[q] su p[q] p q s += 1 s 1 if s == m:
            ans += 1
     s == m s m ans += 1 ans 1 print(ans) print ans return def D():
    n,k = LI()
    v = LI()
    ans = -float("inf")
    for l in range(min(k,n)+1):
        for r in range(min(k,n)-l+1):
            m = 0
            q = v[:l]+v[n-r:]
            q.sort()
            res = max(0,k-r-l)
            for i in range(len(q)):
                if q[i] < 0 and res > 0:
                    res -= 1
                else:
                    m += q[i]
            if m > ans:
                ans = m
    print(ans)
    return

#E D n,k = LI() n LI() LI k v = LI() v LI() LI ans = -float("inf") ans -float("inf") float("inf") float "inf" for l in range(min(k,n)+1):
        for r in range(min(k,n)-l+1):
            m = 0
            q = v[:l]+v[n-r:]
            q.sort()
            res = max(0,k-r-l)
            for i in range(len(q)):
                if q[i] < 0 and res > 0:
                    res -= 1
                else:
                    m += q[i]
            if m > ans:
                ans = m
     l range(min(k,n)+1) range min(k,n)+1 min(k,n) min k n 1 for r in range(min(k,n)-l+1):
            m = 0
            q = v[:l]+v[n-r:]
            q.sort()
            res = max(0,k-r-l)
            for i in range(len(q)):
                if q[i] < 0 and res > 0:
                    res -= 1
                else:
                    m += q[i]
            if m > ans:
                ans = m
     r range(min(k,n)-l+1) range min(k,n)-l+1 min(k,n)-l min(k,n) min k n l 1 m = 0 m 0 q = v[:l]+v[n-r:] q v[:l]+v[n-r:] v[:l] v :l l v[n-r:] v n-r: n-r n r q.sort() q.sort q sort res = max(0,k-r-l) res max(0,k-r-l) max 0 k-r-l k-r k r l for i in range(len(q)):
                if q[i] < 0 and res > 0:
                    res -= 1
                else:
                    m += q[i]
             i range(len(q)) range len(q) len q if q[i] < 0 and res > 0:
                    res -= 1
                else:
                    m += q[i]
             q[i] < 0 and res > 0 q[i] < 0 q[i] q i 0 res > 0 res 0 res -= 1 res 1 m += q[i] m q[i] q i if m > ans:
                ans = m
     m > ans m ans ans = m ans m print(ans) print ans return def E():
    n,q = LI()
    a = LIR(n)
    a.sort(key = lambda x : x[2])
    d = IR(q)
    ans = [-1]*(q+1)
    right = [0]*q
    for s,t,x in a:
        l = bisect.bisect_left(d,s-x)
        r = bisect.bisect_left(d,t-x)
        while l < r:
            while ans[l] != -1:
                l = right[l]
            if r <= l:
                break
            ans[l] = x
            right[l] = r
            l += 1
    print(*ans[:-1], sep = "\n")
    return

#F E n,q = LI() n LI() LI q a = LIR(n) a LIR(n) LIR n a.sort(key = lambda x : x[2]) a.sort a sort key = lambda x : x[2] key lambda x : x[2] x[2] x 2 x d = IR(q) d IR(q) IR q ans = [-1]*(q+1) ans [-1]*(q+1) [-1] -1 q+1 q 1 right = [0]*q right [0]*q [0] 0 q for s,t,x in a:
        l = bisect.bisect_left(d,s-x)
        r = bisect.bisect_left(d,t-x)
        while l < r:
            while ans[l] != -1:
                l = right[l]
            if r <= l:
                break
            ans[l] = x
            right[l] = r
            l += 1
     s t x a l = bisect.bisect_left(d,s-x) l bisect.bisect_left(d,s-x) bisect.bisect_left bisect bisect_left d s-x s x r = bisect.bisect_left(d,t-x) r bisect.bisect_left(d,t-x) bisect.bisect_left bisect bisect_left d t-x t x while l < r:
            while ans[l] != -1:
                l = right[l]
            if r <= l:
                break
            ans[l] = x
            right[l] = r
            l += 1
     l < r l r while ans[l] != -1:
                l = right[l]
             ans[l] != -1 ans[l] ans l -1 l = right[l] l right[l] right l if r <= l:
                break
             r <= l r l break ans[l] = x ans[l] ans l x right[l] = r right[l] right l r l += 1 l 1 print(*ans[:-1], sep = "\n") print *ans[:-1] ans[:-1] ans :-1 -1 sep = "\n" sep "\n" return def F():
    n = I()

    return

#Solve F n = I() n I() I return if __name__ == "__main__":
    E() __name__ == "__main__" __name__ "__main__" E() E def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l SR def A():
    a,p = LI()
    print((a*3+p)//2)
    return

#B def A():
    a,p = LI()
    print((a*3+p)//2)
    return

#B A def E():
    n,q = LI()
    a = LIR(n)
    a.sort(key = lambda x : x[2])
    d = IR(q)
    ans = [-1]*(q+1)
    right = [0]*q
    for s,t,x in a:
        l = bisect.bisect_left(d,s-x)
        r = bisect.bisect_left(d,t-x)
        while l < r:
            while ans[l] != -1:
                l = right[l]
            if r <= l:
                break
            ans[l] = x
            right[l] = r
            l += 1
    print(*ans[:-1], sep = "\n")
    return

#F def E():
    n,q = LI()
    a = LIR(n)
    a.sort(key = lambda x : x[2])
    d = IR(q)
    ans = [-1]*(q+1)
    right = [0]*q
    for s,t,x in a:
        l = bisect.bisect_left(d,s-x)
        r = bisect.bisect_left(d,t-x)
        while l < r:
            while ans[l] != -1:
                l = right[l]
            if r <= l:
                break
            ans[l] = x
            right[l] = r
            l += 1
    print(*ans[:-1], sep = "\n")
    return

#F E def D():
    n,k = LI()
    v = LI()
    ans = -float("inf")
    for l in range(min(k,n)+1):
        for r in range(min(k,n)-l+1):
            m = 0
            q = v[:l]+v[n-r:]
            q.sort()
            res = max(0,k-r-l)
            for i in range(len(q)):
                if q[i] < 0 and res > 0:
                    res -= 1
                else:
                    m += q[i]
            if m > ans:
                ans = m
    print(ans)
    return

#E def D():
    n,k = LI()
    v = LI()
    ans = -float("inf")
    for l in range(min(k,n)+1):
        for r in range(min(k,n)-l+1):
            m = 0
            q = v[:l]+v[n-r:]
            q.sort()
            res = max(0,k-r-l)
            for i in range(len(q)):
                if q[i] < 0 and res > 0:
                    res -= 1
                else:
                    m += q[i]
            if m > ans:
                ans = m
    print(ans)
    return

#E D def C():
    def dfs(d,k):
        if d == n:
            l.append(k)
        else:
            dfs(d+1,k+[0])
            dfs(d+1,k+[1])
    n,m = LI()
    l = []
    dfs(0,[])
    qu = LIR(m)
    p = LI()
    ans = 0
    for k in l:
        s = 0
        for q in range(m):
            num = qu[q][0]
            lis = list(map(lambda x:x-1, qu[q][1:]))
            su = 0
            for i in lis:
                su ^= k[i]
            if su == p[q]:
                s += 1
        if s == m:
            ans += 1
    print(ans)
    return

#D def C():
    def dfs(d,k):
        if d == n:
            l.append(k)
        else:
            dfs(d+1,k+[0])
            dfs(d+1,k+[1])
    n,m = LI()
    l = []
    dfs(0,[])
    qu = LIR(m)
    p = LI()
    ans = 0
    for k in l:
        s = 0
        for q in range(m):
            num = qu[q][0]
            lis = list(map(lambda x:x-1, qu[q][1:]))
            su = 0
            for i in lis:
                su ^= k[i]
            if su == p[q]:
                s += 1
        if s == m:
            ans += 1
    print(ans)
    return

#D C mod = 1000000007 1000000007 mod def F():
    n = I()

    return

#Solve def F():
    n = I()

    return

#Solve F def LS():return list(map(list, sys.stdin.readline().split())) def LS():return list(map(list, sys.stdin.readline().split())) LS def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l LIR def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l LSR def LI(): return list(map(int, sys.stdin.readline().split())) def LI(): return list(map(int, sys.stdin.readline().split())) LI def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l IR def B():
    n = I()
    s = [None for i in range(n)]
    for i in range(n):
        l = input().split()
        s[i] = l+[i]
    s.sort(key = lambda x:(x[0],-int(x[1])))
    for i,a,b in s:
        print(b+1)
    return

#C def B():
    n = I()
    s = [None for i in range(n)]
    for i in range(n):
        l = input().split()
        s[i] = l+[i]
    s.sort(key = lambda x:(x[0],-int(x[1])))
    for i,a,b in s:
        print(b+1)
    return

#C B def S(): return list(sys.stdin.readline())[:-1] def S(): return list(sys.stdin.readline())[:-1] S def I(): return int(sys.stdin.readline()) def I(): return int(sys.stdin.readline()) I
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    a,p = LI()
    print((a*3+p)//2)
    return

#B
def B():
    n = I()
    s = [None for i in range(n)]
    for i in range(n):
        l = input().split()
        s[i] = l+[i]
    s.sort(key = lambda x:(x[0],-int(x[1])))
    for i,a,b in s:
        print(b+1)
    return

#C
def C():
    def dfs(d,k):
        if d == n:
            l.append(k)
        else:
            dfs(d+1,k+[0])
            dfs(d+1,k+[1])
    n,m = LI()
    l = []
    dfs(0,[])
    qu = LIR(m)
    p = LI()
    ans = 0
    for k in l:
        s = 0
        for q in range(m):
            num = qu[q][0]
            lis = list(map(lambda x:x-1, qu[q][1:]))
            su = 0
            for i in lis:
                su ^= k[i]
            if su == p[q]:
                s += 1
        if s == m:
            ans += 1
    print(ans)
    return

#D
def D():
    n,k = LI()
    v = LI()
    ans = -float("inf")
    for l in range(min(k,n)+1):
        for r in range(min(k,n)-l+1):
            m = 0
            q = v[:l]+v[n-r:]
            q.sort()
            res = max(0,k-r-l)
            for i in range(len(q)):
                if q[i] < 0 and res > 0:
                    res -= 1
                else:
                    m += q[i]
            if m > ans:
                ans = m
    print(ans)
    return

#E
def E():
    n,q = LI()
    a = LIR(n)
    a.sort(key = lambda x : x[2])
    d = IR(q)
    ans = [-1]*(q+1)
    right = [0]*q
    for s,t,x in a:
        l = bisect.bisect_left(d,s-x)
        r = bisect.bisect_left(d,t-x)
        while l < r:
            while ans[l] != -1:
                l = right[l]
            if r <= l:
                break
            ans[l] = x
            right[l] = r
            l += 1
    print(*ans[:-1], sep = "\n")
    return

#F
def F():
    n = I()

    return

#Solve
if __name__ == "__main__":
    E()
