import bisect

n,q = list(map(int, input().split()))

list_xst = []
for _ in range(n):
    s,t,x = list(map(int, input().split()))
    list_xst.append([x, s-x, t-x])

list_xst.sort(key=lambda l:l[0])

list_d = [int(input()) for _ in range(q)]

retn = [-1] * q
jmp = [-1] * q

for x,s,t in list_xst:
    i = bisect.bisect_left(list_d, s)
    tt = bisect.bisect_left(list_d, t)
    while i < tt:
        if (jmp[i] != -1):
            i = jmp[i]
        else:
            retn[i] = x
            jmp[i] = tt
            i += 1

print(*retn, sep="\n") import bisect bisect n,q = list(map(int, input().split())) n list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split q list_xst = [] list_xst [] for _ in range(n):
    s,t,x = list(map(int, input().split()))
    list_xst.append([x, s-x, t-x]) _ range(n) range n s,t,x = list(map(int, input().split())) s list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split t x list_xst.append([x, s-x, t-x]) list_xst.append list_xst append [x, s-x, t-x] x s-x s x t-x t x list_xst.sort(key=lambda l:l[0]) list_xst.sort list_xst sort key=lambda l:l[0] key lambda l:l[0] l[0] l 0 l int(input()) for _ in range(q) for _ in range(q) _ range(q) range q for _ in range(q) int(input()) int input() input list_d = [int(input()) for _ in range(q)] list_d [int(input()) for _ in range(q)] retn = [-1] * q retn [-1] * q [-1] -1 q jmp = [-1] * q jmp [-1] * q [-1] -1 q for x,s,t in list_xst:
    i = bisect.bisect_left(list_d, s)
    tt = bisect.bisect_left(list_d, t)
    while i < tt:
        if (jmp[i] != -1):
            i = jmp[i]
        else:
            retn[i] = x
            jmp[i] = tt
            i += 1 x s t list_xst i = bisect.bisect_left(list_d, s) i bisect.bisect_left(list_d, s) bisect.bisect_left bisect bisect_left list_d s tt = bisect.bisect_left(list_d, t) tt bisect.bisect_left(list_d, t) bisect.bisect_left bisect bisect_left list_d t while i < tt:
        if (jmp[i] != -1):
            i = jmp[i]
        else:
            retn[i] = x
            jmp[i] = tt
            i += 1 i < tt i tt if (jmp[i] != -1):
            i = jmp[i]
        else:
            retn[i] = x
            jmp[i] = tt
            i += 1 jmp[i] != -1 jmp[i] jmp i -1 i = jmp[i] i jmp[i] jmp i retn[i] = x retn[i] retn i x jmp[i] = tt jmp[i] jmp i tt i += 1 i 1 print(*retn, sep="\n") print *retn retn sep="\n" sep "\n" n,q = list(map(int, input().split())) list(map(int, input().split())) n i += 1 1 i i = bisect.bisect_left(list_d, s) bisect.bisect_left(list_d, s) i q = list(map(int, input().split())) list(map(int, input().split())) q t,x = list(map(int, input().split())) list(map(int, input().split())) t list_xst = [] [] list_xst jmp = [-1] * q [-1] * q jmp x = list(map(int, input().split())) list(map(int, input().split())) x i = jmp[i] jmp[i] i tt = bisect.bisect_left(list_d, t) bisect.bisect_left(list_d, t) tt retn = [-1] * q [-1] * q retn s,t,x = list(map(int, input().split())) list(map(int, input().split())) s list_d = [int(input()) for _ in range(q)] [int(input()) for _ in range(q)] list_d
import bisect

n,q = list(map(int, input().split()))

list_xst = []
for _ in range(n):
    s,t,x = list(map(int, input().split()))
    list_xst.append([x, s-x, t-x])

list_xst.sort(key=lambda l:l[0])

list_d = [int(input()) for _ in range(q)]

retn = [-1] * q
jmp = [-1] * q

for x,s,t in list_xst:
    i = bisect.bisect_left(list_d, s)
    tt = bisect.bisect_left(list_d, t)
    while i < tt:
        if (jmp[i] != -1):
            i = jmp[i]
        else:
            retn[i] = x
            jmp[i] = tt
            i += 1

print(*retn, sep="\n")