import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
Max = sys.maxsize
def l():
    return list(map(int,input().split()))
def m():
    return map(int,input().split())
def onem():
    return int(input())
def s(x):
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa == x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x):
    return " ".join(map(str,x))

n,m = m()

l = [l() for i in range(n)]
l.sort(key = lambda x:x[2])
ans = [-1]*m
ju = [-1]*m
d = [onem() for i in range(m)]
for s,t,x in l:
    ore = bs.bisect_left(d,s-x)
    o = bs.bisect_left(d,t-x)
    while (ore < o):
        k = ju[ore]
        if k == -1:
            ans[ore] = x
            ju[ore] = o
            ore += 1
        else:
            ore = k
for i in range(m):
    print(ans[i]) import sys,collections as cl,bisect as bs sys collections bisect sys.setrecursionlimit(100000) sys.setrecursionlimit sys setrecursionlimit 100000 Max = sys.maxsize Max sys.maxsize sys maxsize def l():
    return list(map(int,input().split())) l return list(map(int,input().split())) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split def m():
    return map(int,input().split()) m return map(int,input().split()) map(int,input().split()) map int input().split() ().split () input split def onem():
    return int(input()) onem return int(input()) int(input()) int input() input def s(x):
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa == x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a s a = [] a [] aa = x[0] aa x[0] x 0 su = 1 su 1 for i in range(len(x)-1):
        if aa == x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
     i range(len(x)-1) range len(x)-1 len(x) len x 1 if aa == x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
     aa == x[i+1] aa x[i+1] x i+1 i 1 a.append([aa,su]) a.append a append [aa,su] aa su aa = x[i+1] aa x[i+1] x i+1 i 1 su = 1 su 1 su += 1 su 1 a.append([aa,su]) a.append a append [aa,su] aa su return a a x x def jo(x):
    return " ".join(map(str,x)) jo return " ".join(map(str,x)) " ".join(map(str,x)) " ".join " " join map(str,x) map str x x x n,m = m() n m() m m l() for i in range(n) for i in range(n) i range(n) range n for i in range(n) l() l l = [l() for i in range(n)] l [l() for i in range(n)] l.sort(key = lambda x:x[2]) l.sort l sort key = lambda x:x[2] key lambda x:x[2] x[2] x 2 x ans = [-1]*m ans [-1]*m [-1] -1 m ju = [-1]*m ju [-1]*m [-1] -1 m onem() for i in range(m) for i in range(m) i range(m) range m for i in range(m) onem() onem d = [onem() for i in range(m)] d [onem() for i in range(m)] for s,t,x in l:
    ore = bs.bisect_left(d,s-x)
    o = bs.bisect_left(d,t-x)
    while (ore < o):
        k = ju[ore]
        if k == -1:
            ans[ore] = x
            ju[ore] = o
            ore += 1
        else:
            ore = k s t x l ore = bs.bisect_left(d,s-x) ore bs.bisect_left(d,s-x) bs.bisect_left bs bisect_left d s-x s x o = bs.bisect_left(d,t-x) o bs.bisect_left(d,t-x) bs.bisect_left bs bisect_left d t-x t x while (ore < o):
        k = ju[ore]
        if k == -1:
            ans[ore] = x
            ju[ore] = o
            ore += 1
        else:
            ore = k ore < o ore o k = ju[ore] k ju[ore] ju ore if k == -1:
            ans[ore] = x
            ju[ore] = o
            ore += 1
        else:
            ore = k k == -1 k -1 ans[ore] = x ans[ore] ans ore x ju[ore] = o ju[ore] ju ore o ore += 1 ore 1 ore = k ore k for i in range(m):
    print(ans[i]) i range(m) range m print(ans[i]) print ans[i] ans i def onem():
    return int(input()) def onem():
    return int(input()) onem ans = [-1]*m [-1]*m ans k = ju[ore] ju[ore] k m = m() m() m ore += 1 1 ore def s(x):
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa == x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a def s(x):
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa == x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a s def m():
    return map(int,input().split()) def m():
    return map(int,input().split()) m d = [onem() for i in range(m)] [onem() for i in range(m)] d Max = sys.maxsize sys.maxsize Max def l():
    return list(map(int,input().split())) def l():
    return list(map(int,input().split())) l ore = bs.bisect_left(d,s-x) bs.bisect_left(d,s-x) ore def jo(x):
    return " ".join(map(str,x)) def jo(x):
    return " ".join(map(str,x)) jo l = [l() for i in range(n)] [l() for i in range(n)] l o = bs.bisect_left(d,t-x) bs.bisect_left(d,t-x) o ju = [-1]*m [-1]*m ju ore = k k ore n,m = m() m() n
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
Max = sys.maxsize
def l():
    return list(map(int,input().split()))
def m():
    return map(int,input().split())
def onem():
    return int(input())
def s(x):
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa == x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x):
    return " ".join(map(str,x))

n,m = m()

l = [l() for i in range(n)]
l.sort(key = lambda x:x[2])
ans = [-1]*m
ju = [-1]*m
d = [onem() for i in range(m)]
for s,t,x in l:
    ore = bs.bisect_left(d,s-x)
    o = bs.bisect_left(d,t-x)
    while (ore < o):
        k = ju[ore]
        if k == -1:
            ans[ore] = x
            ju[ore] = o
            ore += 1
        else:
            ore = k
for i in range(m):
    print(ans[i])
