import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n,q = LI()
    stx = [LI() for _ in range(n)]
    da = [I() for _ in range(q)]

    q = []
    for s,t,x in stx:
        sx = s - x
        tx = t - x - 1
        heapq.heappush(q, (sx, x, tx))

    t = []
    cx = inf
    ctx = inf
    c = 0
    while len(q):
        sx, x, tx = heapq.heappop(q)
        # print("x", sx,x,tx)
        # print("q", q)
        # print("t", t)
        if sx > ctx:
            t.append((sx-1, cx))
            cx = x
            ctx = tx
        elif cx > x:
            if ctx > tx:
                heapq.heappush(q, (tx+1, cx, ctx))
            t.append((sx-1, cx))
            cx = x
            ctx = tx
        elif tx > ctx:
            heapq.heappush(q, (ctx+1, x, tx))

    t.append((inf, inf))
    # print("t", t)

    r = []
    for d in da:
        i = bisect.bisect_right(t, (d, -1))
        # print("d",d,i,t[i])
        u = t[i][1]
        if u == inf:
            r.append(-1)
        else:
            r.append(u)

    return JA(r, "\n")

print(main())


 import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools math string itertools fractions heapq collections re array bisect sys copy functools import time,random time random sys.setrecursionlimit(10**7) sys.setrecursionlimit sys setrecursionlimit 10**7 10 7 inf = 10**20 inf 10**20 10 20 eps = 1.0 / 10**10 eps 1.0 / 10**10 1.0 10**10 10 10 mod = 10**9+7 mod 10**9+7 10**9 10 9 7 mod2 = 998244353 mod2 998244353 dd = [(-1,0),(0,1),(1,0),(0,-1)] dd [(-1,0),(0,1),(1,0),(0,-1)] (-1,0) -1 0 (0,1) 0 1 (1,0) 1 0 (0,-1) 0 -1 ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] ddn [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] (-1,0) -1 0 (-1,1) -1 1 (0,1) 0 1 (1,1) 1 1 (1,0) 1 0 (1,-1) 1 -1 (0,-1) 0 -1 (-1,-1) -1 -1 def LI(): return list(map(int, sys.stdin.readline().split())) LI list(map(int, l.split())) for l in sys.stdin.readlines() for l in sys.stdin.readlines() l sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines for l in sys.stdin.readlines() list(map(int, l.split())) list map(int, l.split()) map int l.split() l.split l split def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()] LLI int(x)-1 for x in sys.stdin.readline().split() for x in sys.stdin.readline().split() x sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split for x in sys.stdin.readline().split() int(x)-1 int(x) int x 1 def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] LI_ float(x) for x in sys.stdin.readline().split() for x in sys.stdin.readline().split() x sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split for x in sys.stdin.readline().split() float(x) float x def LF(): return [float(x) for x in sys.stdin.readline().split()] LF def LS(): return sys.stdin.readline().split() LS def I(): return int(sys.stdin.readline()) I def F(): return float(sys.stdin.readline()) F def S(): return input() S def pf(s): return print(s, flush=True) pf s s def pe(s): return print(str(s), file=sys.stderr) pe s s def JA(a, sep): return sep.join(map(str, a)) JA a a sep sep def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a) JAA a a s s t t def main():
    n,q = LI()
    stx = [LI() for _ in range(n)]
    da = [I() for _ in range(q)]

    q = []
    for s,t,x in stx:
        sx = s - x
        tx = t - x - 1
        heapq.heappush(q, (sx, x, tx))

    t = []
    cx = inf
    ctx = inf
    c = 0
    while len(q):
        sx, x, tx = heapq.heappop(q)
        # print("x", sx,x,tx)
        # print("q", q)
        # print("t", t)
        if sx > ctx:
            t.append((sx-1, cx))
            cx = x
            ctx = tx
        elif cx > x:
            if ctx > tx:
                heapq.heappush(q, (tx+1, cx, ctx))
            t.append((sx-1, cx))
            cx = x
            ctx = tx
        elif tx > ctx:
            heapq.heappush(q, (ctx+1, x, tx))

    t.append((inf, inf))
    # print("t", t)

    r = []
    for d in da:
        i = bisect.bisect_right(t, (d, -1))
        # print("d",d,i,t[i])
        u = t[i][1]
        if u == inf:
            r.append(-1)
        else:
            r.append(u)

    return JA(r, "\n") main n,q = LI() n LI() LI q LI() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) LI() LI stx = [LI() for _ in range(n)] stx [LI() for _ in range(n)] I() for _ in range(q) for _ in range(q) _ range(q) range q for _ in range(q) I() I da = [I() for _ in range(q)] da [I() for _ in range(q)] q = [] q [] for s,t,x in stx:
        sx = s - x
        tx = t - x - 1
        heapq.heappush(q, (sx, x, tx))

     s t x stx sx = s - x sx s - x s x tx = t - x - 1 tx t - x - 1 t - x t x 1 heapq.heappush(q, (sx, x, tx)) heapq.heappush heapq heappush q (sx, x, tx) sx x tx t = [] t [] cx = inf cx inf ctx = inf ctx inf c = 0 c 0 while len(q):
        sx, x, tx = heapq.heappop(q)
        # print("x", sx,x,tx)
        # print("q", q)
        # print("t", t)
        if sx > ctx:
            t.append((sx-1, cx))
            cx = x
            ctx = tx
        elif cx > x:
            if ctx > tx:
                heapq.heappush(q, (tx+1, cx, ctx))
            t.append((sx-1, cx))
            cx = x
            ctx = tx
        elif tx > ctx:
            heapq.heappush(q, (ctx+1, x, tx))

     len(q) len q sx, x, tx = heapq.heappop(q) sx heapq.heappop(q) heapq.heappop heapq heappop q x tx if sx > ctx:
            t.append((sx-1, cx))
            cx = x
            ctx = tx
        elif cx > x:
            if ctx > tx:
                heapq.heappush(q, (tx+1, cx, ctx))
            t.append((sx-1, cx))
            cx = x
            ctx = tx
        elif tx > ctx:
            heapq.heappush(q, (ctx+1, x, tx))

     sx > ctx sx ctx t.append((sx-1, cx)) t.append t append (sx-1, cx) sx-1 sx 1 cx cx = x cx x ctx = tx ctx tx elif cx > x:
            if ctx > tx:
                heapq.heappush(q, (tx+1, cx, ctx))
            t.append((sx-1, cx))
            cx = x
            ctx = tx
         cx > x cx x if ctx > tx:
                heapq.heappush(q, (tx+1, cx, ctx))
             ctx > tx ctx tx heapq.heappush(q, (tx+1, cx, ctx)) heapq.heappush heapq heappush q (tx+1, cx, ctx) tx+1 tx 1 cx ctx t.append((sx-1, cx)) t.append t append (sx-1, cx) sx-1 sx 1 cx cx = x cx x ctx = tx ctx tx elif tx > ctx:
            heapq.heappush(q, (ctx+1, x, tx))

     tx > ctx tx ctx heapq.heappush(q, (ctx+1, x, tx)) heapq.heappush heapq heappush q (ctx+1, x, tx) ctx+1 ctx 1 x tx t.append((inf, inf)) t.append t append (inf, inf) inf inf r = [] r [] for d in da:
        i = bisect.bisect_right(t, (d, -1))
        # print("d",d,i,t[i])
        u = t[i][1]
        if u == inf:
            r.append(-1)
        else:
            r.append(u)

     d da i = bisect.bisect_right(t, (d, -1)) i bisect.bisect_right(t, (d, -1)) bisect.bisect_right bisect bisect_right t (d, -1) d -1 u = t[i][1] u t[i][1] [i] t i 1 if u == inf:
            r.append(-1)
        else:
            r.append(u)

     u == inf u inf r.append(-1) r.append r append -1 r.append(u) r.append r append u return JA(r, "\n") JA(r, "\n") JA r "\n" print(main()) print main() main def pf(s): return print(s, flush=True) def pf(s): return print(s, flush=True) pf def LS(): return sys.stdin.readline().split() def LS(): return sys.stdin.readline().split() LS def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()] def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()] LLI def JA(a, sep): return sep.join(map(str, a)) def JA(a, sep): return sep.join(map(str, a)) JA def pe(s): return print(str(s), file=sys.stderr) def pe(s): return print(str(s), file=sys.stderr) pe def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a) def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a) JAA def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] LI_ def LI(): return list(map(int, sys.stdin.readline().split())) def LI(): return list(map(int, sys.stdin.readline().split())) LI def I(): return int(sys.stdin.readline()) def I(): return int(sys.stdin.readline()) I def F(): return float(sys.stdin.readline()) def F(): return float(sys.stdin.readline()) F ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] ddn mod2 = 998244353 998244353 mod2 eps = 1.0 / 10**10 1.0 / 10**10 eps dd = [(-1,0),(0,1),(1,0),(0,-1)] [(-1,0),(0,1),(1,0),(0,-1)] dd def S(): return input() def S(): return input() S def LF(): return [float(x) for x in sys.stdin.readline().split()] def LF(): return [float(x) for x in sys.stdin.readline().split()] LF def main():
    n,q = LI()
    stx = [LI() for _ in range(n)]
    da = [I() for _ in range(q)]

    q = []
    for s,t,x in stx:
        sx = s - x
        tx = t - x - 1
        heapq.heappush(q, (sx, x, tx))

    t = []
    cx = inf
    ctx = inf
    c = 0
    while len(q):
        sx, x, tx = heapq.heappop(q)
        # print("x", sx,x,tx)
        # print("q", q)
        # print("t", t)
        if sx > ctx:
            t.append((sx-1, cx))
            cx = x
            ctx = tx
        elif cx > x:
            if ctx > tx:
                heapq.heappush(q, (tx+1, cx, ctx))
            t.append((sx-1, cx))
            cx = x
            ctx = tx
        elif tx > ctx:
            heapq.heappush(q, (ctx+1, x, tx))

    t.append((inf, inf))
    # print("t", t)

    r = []
    for d in da:
        i = bisect.bisect_right(t, (d, -1))
        # print("d",d,i,t[i])
        u = t[i][1]
        if u == inf:
            r.append(-1)
        else:
            r.append(u)

    return JA(r, "\n") def main():
    n,q = LI()
    stx = [LI() for _ in range(n)]
    da = [I() for _ in range(q)]

    q = []
    for s,t,x in stx:
        sx = s - x
        tx = t - x - 1
        heapq.heappush(q, (sx, x, tx))

    t = []
    cx = inf
    ctx = inf
    c = 0
    while len(q):
        sx, x, tx = heapq.heappop(q)
        # print("x", sx,x,tx)
        # print("q", q)
        # print("t", t)
        if sx > ctx:
            t.append((sx-1, cx))
            cx = x
            ctx = tx
        elif cx > x:
            if ctx > tx:
                heapq.heappush(q, (tx+1, cx, ctx))
            t.append((sx-1, cx))
            cx = x
            ctx = tx
        elif tx > ctx:
            heapq.heappush(q, (ctx+1, x, tx))

    t.append((inf, inf))
    # print("t", t)

    r = []
    for d in da:
        i = bisect.bisect_right(t, (d, -1))
        # print("d",d,i,t[i])
        u = t[i][1]
        if u == inf:
            r.append(-1)
        else:
            r.append(u)

    return JA(r, "\n") main inf = 10**20 10**20 inf mod = 10**9+7 10**9+7 mod
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n,q = LI()
    stx = [LI() for _ in range(n)]
    da = [I() for _ in range(q)]

    q = []
    for s,t,x in stx:
        sx = s - x
        tx = t - x - 1
        heapq.heappush(q, (sx, x, tx))

    t = []
    cx = inf
    ctx = inf
    c = 0
    while len(q):
        sx, x, tx = heapq.heappop(q)
        # print("x", sx,x,tx)
        # print("q", q)
        # print("t", t)
        if sx > ctx:
            t.append((sx-1, cx))
            cx = x
            ctx = tx
        elif cx > x:
            if ctx > tx:
                heapq.heappush(q, (tx+1, cx, ctx))
            t.append((sx-1, cx))
            cx = x
            ctx = tx
        elif tx > ctx:
            heapq.heappush(q, (ctx+1, x, tx))

    t.append((inf, inf))
    # print("t", t)

    r = []
    for d in da:
        i = bisect.bisect_right(t, (d, -1))
        # print("d",d,i,t[i])
        u = t[i][1]
        if u == inf:
            r.append(-1)
        else:
            r.append(u)

    return JA(r, "\n")

print(main())



