#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True  and False
BIG = 10**18 if not DBG else 99999
R = 10**9 + 7
#R = 998244353

def ddprint(x):
  if DBG:
    print(x)


# # # # class Segtree # # # #

#      0
#   1     2
# 3   4  5  6
#       :
# leaf i - n-1+i
# parent   - (i-1)//2
# children - 2*i+1, 2*i+2

class Segtree:
    # modify UNIT and oper depending on the reduce operation

    #UNIT = 0  # sum/or:0 and:fff..f min:BIG max:-BIG gcd:0 lcm:1 ..

    #@classmethod
    #def oper(c,x,y):
    #    return x|y  # sum:+ or/and/min/max/gcd/lcm:(same)

    # call like this: sgt = Segtree(n, 0, lambda x,y: max(x,y))

    def __init__(s,l,unit,oper):
        s.unit = unit
        s.oper = oper
        s.n = 1
        while s.n<l:
            s.n *= 2
        s.ary = [s.unit for i in range(2*s.n-1)]

    def get(s,i):
        return s.ary[i+s.n-1]

    def set(s,i,v):
        k = i+s.n-1
        s.ary[k] = v
        while k>0:
            k = (k-1)//2
            s.ary[k] = s.oper( \
                        s.ary[2*k+1], s.ary[2*k+2])

    def setary(s,a):
        for i,v in enumerate(a):
            s.ary[i+s.n-1] = v
        for k in range(s.n-2,-1,-1):
            s.ary[k] = s.oper( \
                        s.ary[2*k+1], s.ary[2*k+2])

    def query(s,x,y):
        l = x+s.n-1
        r = y+s.n-1
        res = s.unit
        while l<r:
            if not l%2:
                res = s.oper(res,s.ary[l])
                l += 1
            if not r%2:
                r -= 1
                res = s.oper(res,s.ary[r])
            l >>= 1
            r >>= 1
        return res


# # # # class Segtree end # # # #

n,q = inm()
xs = set([])
stx = []
for i in range(n):
    s,t,x = inm()
    xs.add(x)
    xs.add(s-x)
    xs.add(t-x)
    stx.append((s-x,t-x,x))
stx.sort()

di = []
ans = [-1]*q
for i in range(q):
    d = inn()
    xs.add(d)
    di.append(d)

x2i = {}
i2x = list(xs)
m = len(xs)
i2x.sort()
for i,x in enumerate(i2x):
    x2i[x] = i

stx2 = []
for i in range(n):
    s,t,x = stx[i]
    stx2.append((x2i[s],x2i[t],x2i[x]))
d2 = [x2i[d] for d in di]

sgt = Segtree(m,BIG,lambda x,y: min(x,y))
top = 0
for j in range(q):
    d = d2[j]
    while top<n:
        s,t,x = stx2[top]
        if s>d:
            break
        if x<sgt.get(t-1):
            sgt.set(t-1,x)
        top += 1
    x = sgt.query(d,m)
    if x==BIG:
        print(-1)
    else:
        print(i2x[x]) printn = lambda x: print(x,end='') printn lambda x: print(x,end='') print(x,end='') print x end='' end '' x inn = lambda : int(input()) inn lambda : int(input()) int(input()) int input() input inl   = lambda: list(map(int, input().split())) inl lambda: list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split inm   = lambda:      map(int, input().split()) inm lambda:      map(int, input().split()) map(int, input().split()) map int input().split() ().split () input split ins = lambda : input().strip() ins lambda : input().strip() input().strip() ().strip () input strip DBG = True  and False DBG True  and False True False BIG = 10**18 if not DBG else 99999 BIG 10**18 if not DBG else 99999 not DBG DBG 10**18 10 18 99999 R = 10**9 + 7 R 10**9 + 7 10**9 10 9 7 def ddprint(x):
  if DBG:
    print(x)


# # # # class Segtree # # # #

#      0
#   1     2
# 3   4  5  6
#       :
# leaf i - n-1+i
# parent   - (i-1)//2
# children - 2*i+1, 2*i+2 ddprint if DBG:
    print(x)


# # # # class Segtree # # # #

#      0
#   1     2
# 3   4  5  6
#       :
# leaf i - n-1+i
# parent   - (i-1)//2
# children - 2*i+1, 2*i+2 DBG print(x) print x x x class Segtree:
    # modify UNIT and oper depending on the reduce operation

    #UNIT = 0  # sum/or:0 and:fff..f min:BIG max:-BIG gcd:0 lcm:1 ..

    #@classmethod
    #def oper(c,x,y):
    #    return x|y  # sum:+ or/and/min/max/gcd/lcm:(same)

    # call like this: sgt = Segtree(n, 0, lambda x,y: max(x,y))

    def __init__(s,l,unit,oper):
        s.unit = unit
        s.oper = oper
        s.n = 1
        while s.n<l:
            s.n *= 2
        s.ary = [s.unit for i in range(2*s.n-1)]

    def get(s,i):
        return s.ary[i+s.n-1]

    def set(s,i,v):
        k = i+s.n-1
        s.ary[k] = v
        while k>0:
            k = (k-1)//2
            s.ary[k] = s.oper( \
                        s.ary[2*k+1], s.ary[2*k+2])

    def setary(s,a):
        for i,v in enumerate(a):
            s.ary[i+s.n-1] = v
        for k in range(s.n-2,-1,-1):
            s.ary[k] = s.oper( \
                        s.ary[2*k+1], s.ary[2*k+2])

    def query(s,x,y):
        l = x+s.n-1
        r = y+s.n-1
        res = s.unit
        while l<r:
            if not l%2:
                res = s.oper(res,s.ary[l])
                l += 1
            if not r%2:
                r -= 1
                res = s.oper(res,s.ary[r])
            l >>= 1
            r >>= 1
        return res


# # # # class Segtree end # # # # Segtree def __init__(s,l,unit,oper):
        s.unit = unit
        s.oper = oper
        s.n = 1
        while s.n<l:
            s.n *= 2
        s.ary = [s.unit for i in range(2*s.n-1)]

     __init__ s.unit = unit s.unit s unit unit s.oper = oper s.oper s oper oper s.n = 1 s.n s n 1 while s.n<l:
            s.n *= 2
         s.n<l s.n s n l s.n *= 2 s.n s n 2 s.unit for i in range(2*s.n-1) for i in range(2*s.n-1) i range(2*s.n-1) range 2*s.n-1 2*s.n 2 s.n s n 1 for i in range(2*s.n-1) s.unit s unit s.ary = [s.unit for i in range(2*s.n-1)] s.ary s ary [s.unit for i in range(2*s.n-1)] s s l l unit unit oper oper def get(s,i):
        return s.ary[i+s.n-1]

     get return s.ary[i+s.n-1] s.ary[i+s.n-1] s.ary s ary i+s.n-1 i+s.n i s.n s n 1 s s i i def set(s,i,v):
        k = i+s.n-1
        s.ary[k] = v
        while k>0:
            k = (k-1)//2
            s.ary[k] = s.oper( \
                        s.ary[2*k+1], s.ary[2*k+2])

     set k = i+s.n-1 k i+s.n-1 i+s.n i s.n s n 1 s.ary[k] = v s.ary[k] s.ary s ary k v while k>0:
            k = (k-1)//2
            s.ary[k] = s.oper( \
                        s.ary[2*k+1], s.ary[2*k+2])

     k>0 k 0 k = (k-1)//2 k (k-1)//2 k-1 k 1 2 s.ary[k] = s.oper( \
                        s.ary[2*k+1], s.ary[2*k+2]) s.ary[k] s.ary s ary k s.oper( \
                        s.ary[2*k+1], s.ary[2*k+2]) s.oper s oper s.ary[2*k+1] s.ary s ary 2*k+1 2*k 2 k 1 s.ary[2*k+2] s.ary s ary 2*k+2 2*k 2 k 2 s s i i v v def setary(s,a):
        for i,v in enumerate(a):
            s.ary[i+s.n-1] = v
        for k in range(s.n-2,-1,-1):
            s.ary[k] = s.oper( \
                        s.ary[2*k+1], s.ary[2*k+2])

     setary for i,v in enumerate(a):
            s.ary[i+s.n-1] = v
         i v enumerate(a) enumerate a s.ary[i+s.n-1] = v s.ary[i+s.n-1] s.ary s ary i+s.n-1 i+s.n i s.n s n 1 v for k in range(s.n-2,-1,-1):
            s.ary[k] = s.oper( \
                        s.ary[2*k+1], s.ary[2*k+2])

     k range(s.n-2,-1,-1) range s.n-2 s.n s n 2 -1 -1 s.ary[k] = s.oper( \
                        s.ary[2*k+1], s.ary[2*k+2]) s.ary[k] s.ary s ary k s.oper( \
                        s.ary[2*k+1], s.ary[2*k+2]) s.oper s oper s.ary[2*k+1] s.ary s ary 2*k+1 2*k 2 k 1 s.ary[2*k+2] s.ary s ary 2*k+2 2*k 2 k 2 s s a a def query(s,x,y):
        l = x+s.n-1
        r = y+s.n-1
        res = s.unit
        while l<r:
            if not l%2:
                res = s.oper(res,s.ary[l])
                l += 1
            if not r%2:
                r -= 1
                res = s.oper(res,s.ary[r])
            l >>= 1
            r >>= 1
        return res


# # # # class Segtree end # # # # query l = x+s.n-1 l x+s.n-1 x+s.n x s.n s n 1 r = y+s.n-1 r y+s.n-1 y+s.n y s.n s n 1 res = s.unit res s.unit s unit while l<r:
            if not l%2:
                res = s.oper(res,s.ary[l])
                l += 1
            if not r%2:
                r -= 1
                res = s.oper(res,s.ary[r])
            l >>= 1
            r >>= 1
         l<r l r if not l%2:
                res = s.oper(res,s.ary[l])
                l += 1
             not l%2 l%2 l 2 res = s.oper(res,s.ary[l]) res s.oper(res,s.ary[l]) s.oper s oper res s.ary[l] s.ary s ary l l += 1 l 1 if not r%2:
                r -= 1
                res = s.oper(res,s.ary[r])
             not r%2 r%2 r 2 r -= 1 r 1 res = s.oper(res,s.ary[r]) res s.oper(res,s.ary[r]) s.oper s oper res s.ary[r] s.ary s ary r l >>= 1 l 1 r >>= 1 r 1 return res res s s x x y y n,q = inm() n inm() inm q xs = set([]) xs set([]) set [] stx = [] stx [] for i in range(n):
    s,t,x = inm()
    xs.add(x)
    xs.add(s-x)
    xs.add(t-x)
    stx.append((s-x,t-x,x)) i range(n) range n s,t,x = inm() s inm() inm t x xs.add(x) xs.add xs add x xs.add(s-x) xs.add xs add s-x s x xs.add(t-x) xs.add xs add t-x t x stx.append((s-x,t-x,x)) stx.append stx append (s-x,t-x,x) s-x s x t-x t x x stx.sort() stx.sort stx sort di = [] di [] ans = [-1]*q ans [-1]*q [-1] -1 q for i in range(q):
    d = inn()
    xs.add(d)
    di.append(d) i range(q) range q d = inn() d inn() inn xs.add(d) xs.add xs add d di.append(d) di.append di append d x2i = {} x2i {} i2x = list(xs) i2x list(xs) list xs m = len(xs) m len(xs) len xs i2x.sort() i2x.sort i2x sort for i,x in enumerate(i2x):
    x2i[x] = i i x enumerate(i2x) enumerate i2x x2i[x] = i x2i[x] x2i x i stx2 = [] stx2 [] for i in range(n):
    s,t,x = stx[i]
    stx2.append((x2i[s],x2i[t],x2i[x])) i range(n) range n s,t,x = stx[i] s stx[i] stx i t x stx2.append((x2i[s],x2i[t],x2i[x])) stx2.append stx2 append (x2i[s],x2i[t],x2i[x]) x2i[s] x2i s x2i[t] x2i t x2i[x] x2i x x2i[d] for d in di for d in di d di for d in di x2i[d] x2i d d2 = [x2i[d] for d in di] d2 [x2i[d] for d in di] sgt = Segtree(m,BIG,lambda x,y: min(x,y)) sgt Segtree(m,BIG,lambda x,y: min(x,y)) Segtree m BIG lambda x,y: min(x,y) min(x,y) min x y x y top = 0 top 0 for j in range(q):
    d = d2[j]
    while top<n:
        s,t,x = stx2[top]
        if s>d:
            break
        if x<sgt.get(t-1):
            sgt.set(t-1,x)
        top += 1
    x = sgt.query(d,m)
    if x==BIG:
        print(-1)
    else:
        print(i2x[x]) j range(q) range q d = d2[j] d d2[j] d2 j while top<n:
        s,t,x = stx2[top]
        if s>d:
            break
        if x<sgt.get(t-1):
            sgt.set(t-1,x)
        top += 1
     top<n top n s,t,x = stx2[top] s stx2[top] stx2 top t x if s>d:
            break
         s>d s d break if x<sgt.get(t-1):
            sgt.set(t-1,x)
         x<sgt.get(t-1) x sgt.get(t-1) sgt.get sgt get t-1 t 1 sgt.set(t-1,x) sgt.set sgt set t-1 t 1 x top += 1 top 1 x = sgt.query(d,m) x sgt.query(d,m) sgt.query sgt query d m if x==BIG:
        print(-1)
    else:
        print(i2x[x]) x==BIG x BIG print(-1) print -1 print(i2x[x]) print i2x[x] i2x x x = stx[i] stx[i] x inm   = lambda:      map(int, input().split()) lambda:      map(int, input().split()) inm d = inn() inn() d d = d2[j] d2[j] d di = [] [] di stx = [] [] stx top += 1 1 top class Segtree:
    # modify UNIT and oper depending on the reduce operation

    #UNIT = 0  # sum/or:0 and:fff..f min:BIG max:-BIG gcd:0 lcm:1 ..

    #@classmethod
    #def oper(c,x,y):
    #    return x|y  # sum:+ or/and/min/max/gcd/lcm:(same)

    # call like this: sgt = Segtree(n, 0, lambda x,y: max(x,y))

    def __init__(s,l,unit,oper):
        s.unit = unit
        s.oper = oper
        s.n = 1
        while s.n<l:
            s.n *= 2
        s.ary = [s.unit for i in range(2*s.n-1)]

    def get(s,i):
        return s.ary[i+s.n-1]

    def set(s,i,v):
        k = i+s.n-1
        s.ary[k] = v
        while k>0:
            k = (k-1)//2
            s.ary[k] = s.oper( \
                        s.ary[2*k+1], s.ary[2*k+2])

    def setary(s,a):
        for i,v in enumerate(a):
            s.ary[i+s.n-1] = v
        for k in range(s.n-2,-1,-1):
            s.ary[k] = s.oper( \
                        s.ary[2*k+1], s.ary[2*k+2])

    def query(s,x,y):
        l = x+s.n-1
        r = y+s.n-1
        res = s.unit
        while l<r:
            if not l%2:
                res = s.oper(res,s.ary[l])
                l += 1
            if not r%2:
                r -= 1
                res = s.oper(res,s.ary[r])
            l >>= 1
            r >>= 1
        return res


# # # # class Segtree end # # # # class Segtree:
    # modify UNIT and oper depending on the reduce operation

    #UNIT = 0  # sum/or:0 and:fff..f min:BIG max:-BIG gcd:0 lcm:1 ..

    #@classmethod
    #def oper(c,x,y):
    #    return x|y  # sum:+ or/and/min/max/gcd/lcm:(same)

    # call like this: sgt = Segtree(n, 0, lambda x,y: max(x,y))

    def __init__(s,l,unit,oper):
        s.unit = unit
        s.oper = oper
        s.n = 1
        while s.n<l:
            s.n *= 2
        s.ary = [s.unit for i in range(2*s.n-1)]

    def get(s,i):
        return s.ary[i+s.n-1]

    def set(s,i,v):
        k = i+s.n-1
        s.ary[k] = v
        while k>0:
            k = (k-1)//2
            s.ary[k] = s.oper( \
                        s.ary[2*k+1], s.ary[2*k+2])

    def setary(s,a):
        for i,v in enumerate(a):
            s.ary[i+s.n-1] = v
        for k in range(s.n-2,-1,-1):
            s.ary[k] = s.oper( \
                        s.ary[2*k+1], s.ary[2*k+2])

    def query(s,x,y):
        l = x+s.n-1
        r = y+s.n-1
        res = s.unit
        while l<r:
            if not l%2:
                res = s.oper(res,s.ary[l])
                l += 1
            if not r%2:
                r -= 1
                res = s.oper(res,s.ary[r])
            l >>= 1
            r >>= 1
        return res


# # # # class Segtree end # # # # Segtree ins = lambda : input().strip() lambda : input().strip() ins BIG = 10**18 if not DBG else 99999 10**18 if not DBG else 99999 BIG m = len(xs) len(xs) m t,x = inm() inm() t printn = lambda x: print(x,end='') lambda x: print(x,end='') printn DBG = True  and False True  and False DBG def ddprint(x):
  if DBG:
    print(x)


# # # # class Segtree # # # #

#      0
#   1     2
# 3   4  5  6
#       :
# leaf i - n-1+i
# parent   - (i-1)//2
# children - 2*i+1, 2*i+2 def ddprint(x):
  if DBG:
    print(x)


# # # # class Segtree # # # #

#      0
#   1     2
# 3   4  5  6
#       :
# leaf i - n-1+i
# parent   - (i-1)//2
# children - 2*i+1, 2*i+2 ddprint q = inm() inm() q t,x = stx[i] stx[i] t x = sgt.query(d,m) sgt.query(d,m) x x2i = {} {} x2i xs = set([]) set([]) xs sgt = Segtree(m,BIG,lambda x,y: min(x,y)) Segtree(m,BIG,lambda x,y: min(x,y)) sgt top = 0 0 top n,q = inm() inm() n x = inm() inm() x i2x = list(xs) list(xs) i2x t,x = stx2[top] stx2[top] t inl   = lambda: list(map(int, input().split())) lambda: list(map(int, input().split())) inl inn = lambda : int(input()) lambda : int(input()) inn ans = [-1]*q [-1]*q ans R = 10**9 + 7 10**9 + 7 R d2 = [x2i[d] for d in di] [x2i[d] for d in di] d2 stx2 = [] [] stx2 s,t,x = stx2[top] stx2[top] s s,t,x = inm() inm() s x = stx2[top] stx2[top] x s,t,x = stx[i] stx[i] s
#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True  and False
BIG = 10**18 if not DBG else 99999
R = 10**9 + 7
#R = 998244353

def ddprint(x):
  if DBG:
    print(x)


# # # # class Segtree # # # #

#      0
#   1     2
# 3   4  5  6
#       :
# leaf i - n-1+i
# parent   - (i-1)//2
# children - 2*i+1, 2*i+2

class Segtree:
    # modify UNIT and oper depending on the reduce operation

    #UNIT = 0  # sum/or:0 and:fff..f min:BIG max:-BIG gcd:0 lcm:1 ..

    #@classmethod
    #def oper(c,x,y):
    #    return x|y  # sum:+ or/and/min/max/gcd/lcm:(same)

    # call like this: sgt = Segtree(n, 0, lambda x,y: max(x,y))

    def __init__(s,l,unit,oper):
        s.unit = unit
        s.oper = oper
        s.n = 1
        while s.n<l:
            s.n *= 2
        s.ary = [s.unit for i in range(2*s.n-1)]

    def get(s,i):
        return s.ary[i+s.n-1]

    def set(s,i,v):
        k = i+s.n-1
        s.ary[k] = v
        while k>0:
            k = (k-1)//2
            s.ary[k] = s.oper( \
                        s.ary[2*k+1], s.ary[2*k+2])

    def setary(s,a):
        for i,v in enumerate(a):
            s.ary[i+s.n-1] = v
        for k in range(s.n-2,-1,-1):
            s.ary[k] = s.oper( \
                        s.ary[2*k+1], s.ary[2*k+2])

    def query(s,x,y):
        l = x+s.n-1
        r = y+s.n-1
        res = s.unit
        while l<r:
            if not l%2:
                res = s.oper(res,s.ary[l])
                l += 1
            if not r%2:
                r -= 1
                res = s.oper(res,s.ary[r])
            l >>= 1
            r >>= 1
        return res


# # # # class Segtree end # # # #

n,q = inm()
xs = set([])
stx = []
for i in range(n):
    s,t,x = inm()
    xs.add(x)
    xs.add(s-x)
    xs.add(t-x)
    stx.append((s-x,t-x,x))
stx.sort()

di = []
ans = [-1]*q
for i in range(q):
    d = inn()
    xs.add(d)
    di.append(d)

x2i = {}
i2x = list(xs)
m = len(xs)
i2x.sort()
for i,x in enumerate(i2x):
    x2i[x] = i

stx2 = []
for i in range(n):
    s,t,x = stx[i]
    stx2.append((x2i[s],x2i[t],x2i[x]))
d2 = [x2i[d] for d in di]

sgt = Segtree(m,BIG,lambda x,y: min(x,y))
top = 0
for j in range(q):
    d = d2[j]
    while top<n:
        s,t,x = stx2[top]
        if s>d:
            break
        if x<sgt.get(t-1):
            sgt.set(t-1,x)
        top += 1
    x = sgt.query(d,m)
    if x==BIG:
        print(-1)
    else:
        print(i2x[x])
