import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) 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 II(): return int(sys.stdin.readline())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res
def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y

N,Q=LI()
HQ=[]
EVS=[]
for i in range(N):
    S,T,X=LI()
    EVS.append((S-0.5-X, 1, X))
    EVS.append((T-0.5-X, 0, X))
for i in range(Q):
    D=II()
    EVS.append((D, 2, D))
EVS.sort()

st=set()
PQ=[]
for time, ev, loc in EVS:
    if ev == 1:
        heapq.heappush(PQ, loc)
        st.add(loc)
    elif ev == 0:
        st.remove(loc)
    else:
        while PQ and PQ[0] not in st:
            heapq.heappop(PQ)
        if PQ:
            print(PQ[0])
        else:
            print(-1) import sys sys import math math import heapq heapq sys.setrecursionlimit(10**7) sys.setrecursionlimit sys setrecursionlimit 10**7 10 7 INTMAX = 9223372036854775807 INTMAX 9223372036854775807 INTMIN = -9223372036854775808 INTMIN -9223372036854775808 DVSR = 1000000007 DVSR 1000000007 def POW(x, y): return pow(x, y, DVSR) POW x x y y def INV(x, m=DVSR): return pow(x, m - 2, m) INV x x m=DVSR m DVSR def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m DIV x x y y m=DVSR m DVSR int(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() int(x) int x def LI(): return [int(x) 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 II(): return int(sys.stdin.readline()) II def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res FLIST res = [1] res [1] 1 for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
     i range(1, n+1) range 1 n+1 n 1 return res res n n def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y gcd if x < y: x, y = y, x
     x < y x y div = x % y div x % y x y while div != 0:
        x, y = y, div
        div = x % y
     div != 0 div 0 x, y = y, div x y y div div = x % y div x % y x y return y y x x y y N,Q=LI() N LI() LI Q HQ=[] HQ [] EVS=[] EVS [] for i in range(N):
    S,T,X=LI()
    EVS.append((S-0.5-X, 1, X))
    EVS.append((T-0.5-X, 0, X)) i range(N) range N S,T,X=LI() S LI() LI T X EVS.append((S-0.5-X, 1, X)) EVS.append EVS append (S-0.5-X, 1, X) S-0.5-X S-0.5 S 0.5 X 1 X EVS.append((T-0.5-X, 0, X)) EVS.append EVS append (T-0.5-X, 0, X) T-0.5-X T-0.5 T 0.5 X 0 X for i in range(Q):
    D=II()
    EVS.append((D, 2, D)) i range(Q) range Q D=II() D II() II EVS.append((D, 2, D)) EVS.append EVS append (D, 2, D) D 2 D EVS.sort() EVS.sort EVS sort st=set() st set() set PQ=[] PQ [] for time, ev, loc in EVS:
    if ev == 1:
        heapq.heappush(PQ, loc)
        st.add(loc)
    elif ev == 0:
        st.remove(loc)
    else:
        while PQ and PQ[0] not in st:
            heapq.heappop(PQ)
        if PQ:
            print(PQ[0])
        else:
            print(-1) time ev loc EVS if ev == 1:
        heapq.heappush(PQ, loc)
        st.add(loc)
    elif ev == 0:
        st.remove(loc)
    else:
        while PQ and PQ[0] not in st:
            heapq.heappop(PQ)
        if PQ:
            print(PQ[0])
        else:
            print(-1) ev == 1 ev 1 heapq.heappush(PQ, loc) heapq.heappush heapq heappush PQ loc st.add(loc) st.add st add loc elif ev == 0:
        st.remove(loc)
     ev == 0 ev 0 st.remove(loc) st.remove st remove loc while PQ and PQ[0] not in st:
            heapq.heappop(PQ)
         PQ and PQ[0] not in st PQ PQ[0] not in st PQ[0] PQ 0 st heapq.heappop(PQ) heapq.heappop heapq heappop PQ if PQ:
            print(PQ[0])
        else:
            print(-1) PQ print(PQ[0]) print PQ[0] PQ 0 print(-1) print -1 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI(): return [int(x) for x in sys.stdin.readline().split()] LI D=II() II() D 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 X=LI() LI() X DVSR = 1000000007 1000000007 DVSR def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y gcd HQ=[] [] HQ def II(): return int(sys.stdin.readline()) def II(): return int(sys.stdin.readline()) II T,X=LI() LI() T def LS(): return sys.stdin.readline().split() def LS(): return sys.stdin.readline().split() LS PQ=[] [] PQ def INV(x, m=DVSR): return pow(x, m - 2, m) def INV(x, m=DVSR): return pow(x, m - 2, m) INV S,T,X=LI() LI() S INTMAX = 9223372036854775807 9223372036854775807 INTMAX INTMIN = -9223372036854775808 -9223372036854775808 INTMIN Q=LI() LI() Q def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m DIV def POW(x, y): return pow(x, y, DVSR) def POW(x, y): return pow(x, y, DVSR) POW N,Q=LI() LI() N EVS=[] [] EVS st=set() set() st def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res FLIST
import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) 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 II(): return int(sys.stdin.readline())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res
def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y

N,Q=LI()
HQ=[]
EVS=[]
for i in range(N):
    S,T,X=LI()
    EVS.append((S-0.5-X, 1, X))
    EVS.append((T-0.5-X, 0, X))
for i in range(Q):
    D=II()
    EVS.append((D, 2, D))
EVS.sort()

st=set()
PQ=[]
for time, ev, loc in EVS:
    if ev == 1:
        heapq.heappush(PQ, loc)
        st.add(loc)
    elif ev == 0:
        st.remove(loc)
    else:
        while PQ and PQ[0] not in st:
            heapq.heappop(PQ)
        if PQ:
            print(PQ[0])
        else:
            print(-1)
