import sys
input = sys.stdin.readline

n,q = map(int, input().split())
# stx = [tuple(map(int, input().split())) for _ in range(n)]
stx = [0]*n
for i in range(n):
    stx[i] = tuple(map(int, input().split()))
# d = [int(input()) for _ in range(q)]
d = [0]*q
for i in range(q):
    d[i] = int(input())

#これはセグ木 * bisect
import bisect
inf = 10**9 + 100

# 定数倍高速化
b_left = bisect.bisect_left
b_right = bisect.bisect_right

def init(n,init_num=0):
    num = len(str(bin(n-1))) + 1
    seg = [init_num] * (2**num)
    # seg[0] = 2**(num-1)
    seg0 = 2**(num-1)
    return(seg,seg0)

def update(head, tail, x):
    # print('{} {} {}'.format(head, tail, x))
    head += seg0
    tail += seg0
    points = []
    while(head <= tail):
        if(head == tail):
            points.append(head)
            break

        if(head % 2 ==1):
            points.append(head)
            head += 1
        head = head//2

        if(tail % 2 == 0):
            points.append(tail)
            tail -= 1
        tail = (tail-1)//2

    for point in points:
        seg[point] = min(seg[point], x)

def execute_all():
    for i in range(2,len(seg)):
        seg[i] = min(seg[i], seg[i//2])


seg,seg0 = init(q, init_num = inf)

for i in range(n):
    left = b_left(d, stx[i][0] -stx[i][2])
    right = b_right(d, stx[i][1] - stx[i][2] -1) -1
    update(left, right, stx[i][2])
    # print('{} {} {}'.format(left, right, stx[i][2]))

execute_all()

for i in seg[seg0: seg0 + q]:
    if(i == inf):
        print(-1)
    else:
        print(i) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline n,q = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split q stx = [0]*n stx [0]*n [0] 0 n for i in range(n):
    stx[i] = tuple(map(int, input().split()))
# d = [int(input()) for _ in range(q)] i range(n) range n stx[i] = tuple(map(int, input().split())) stx[i] stx i tuple(map(int, input().split())) tuple map(int, input().split()) map int input().split() ().split () input split d = [0]*q d [0]*q [0] 0 q for i in range(q):
    d[i] = int(input())

#これはセグ木 * bisect i range(q) range q d[i] = int(input()) d[i] d i int(input()) int input() input import bisect bisect inf = 10**9 + 100 inf 10**9 + 100 10**9 10 9 100 b_left = bisect.bisect_left b_left bisect.bisect_left bisect bisect_left b_right = bisect.bisect_right b_right bisect.bisect_right bisect bisect_right def init(n,init_num=0):
    num = len(str(bin(n-1))) + 1
    seg = [init_num] * (2**num)
    # seg[0] = 2**(num-1)
    seg0 = 2**(num-1)
    return(seg,seg0) init num = len(str(bin(n-1))) + 1 num len(str(bin(n-1))) + 1 len(str(bin(n-1))) len str(bin(n-1)) str bin(n-1) bin n-1 n 1 1 seg = [init_num] * (2**num) seg [init_num] * (2**num) [init_num] init_num 2**num 2 num seg0 = 2**(num-1) seg0 2**(num-1) 2 num-1 num 1 return(seg,seg0) (seg,seg0) seg seg0 n n init_num=0 init_num 0 def update(head, tail, x):
    # print('{} {} {}'.format(head, tail, x))
    head += seg0
    tail += seg0
    points = []
    while(head <= tail):
        if(head == tail):
            points.append(head)
            break

        if(head % 2 ==1):
            points.append(head)
            head += 1
        head = head//2

        if(tail % 2 == 0):
            points.append(tail)
            tail -= 1
        tail = (tail-1)//2

    for point in points:
        seg[point] = min(seg[point], x) update head += seg0 head seg0 tail += seg0 tail seg0 points = [] points [] while(head <= tail):
        if(head == tail):
            points.append(head)
            break

        if(head % 2 ==1):
            points.append(head)
            head += 1
        head = head//2

        if(tail % 2 == 0):
            points.append(tail)
            tail -= 1
        tail = (tail-1)//2

     head <= tail head tail if(head == tail):
            points.append(head)
            break

         head == tail head tail points.append(head) points.append points append head break if(head % 2 ==1):
            points.append(head)
            head += 1
         head % 2 ==1 head % 2 head 2 1 points.append(head) points.append points append head head += 1 head 1 head = head//2 head head//2 head 2 if(tail % 2 == 0):
            points.append(tail)
            tail -= 1
         tail % 2 == 0 tail % 2 tail 2 0 points.append(tail) points.append points append tail tail -= 1 tail 1 tail = (tail-1)//2 tail (tail-1)//2 tail-1 tail 1 2 for point in points:
        seg[point] = min(seg[point], x) point points seg[point] = min(seg[point], x) seg[point] seg point min(seg[point], x) min seg[point] seg point x head head tail tail x x def execute_all():
    for i in range(2,len(seg)):
        seg[i] = min(seg[i], seg[i//2]) execute_all for i in range(2,len(seg)):
        seg[i] = min(seg[i], seg[i//2]) i range(2,len(seg)) range 2 len(seg) len seg seg[i] = min(seg[i], seg[i//2]) seg[i] seg i min(seg[i], seg[i//2]) min seg[i] seg i seg[i//2] seg i//2 i 2 seg,seg0 = init(q, init_num = inf) seg init(q, init_num = inf) init q init_num = inf init_num inf seg0 for i in range(n):
    left = b_left(d, stx[i][0] -stx[i][2])
    right = b_right(d, stx[i][1] - stx[i][2] -1) -1
    update(left, right, stx[i][2])
    # print('{} {} {}'.format(left, right, stx[i][2])) i range(n) range n left = b_left(d, stx[i][0] -stx[i][2]) left b_left(d, stx[i][0] -stx[i][2]) b_left d stx[i][0] -stx[i][2] stx[i][0] [i] stx i 0 stx[i][2] [i] stx i 2 right = b_right(d, stx[i][1] - stx[i][2] -1) -1 right b_right(d, stx[i][1] - stx[i][2] -1) -1 b_right(d, stx[i][1] - stx[i][2] -1) b_right d stx[i][1] - stx[i][2] -1 stx[i][1] - stx[i][2] stx[i][1] [i] stx i 1 stx[i][2] [i] stx i 2 1 1 update(left, right, stx[i][2]) update left right stx[i][2] [i] stx i 2 execute_all() execute_all for i in seg[seg0: seg0 + q]:
    if(i == inf):
        print(-1)
    else:
        print(i) i seg[seg0: seg0 + q] seg seg0: seg0 + q seg0 seg0 + q seg0 q if(i == inf):
        print(-1)
    else:
        print(i) i == inf i inf print(-1) print -1 print(i) print i n,q = map(int, input().split()) map(int, input().split()) n input = sys.stdin.readline sys.stdin.readline input b_left = bisect.bisect_left bisect.bisect_left b_left left = b_left(d, stx[i][0] -stx[i][2]) b_left(d, stx[i][0] -stx[i][2]) left seg0 = init(q, init_num = inf) init(q, init_num = inf) seg0 def update(head, tail, x):
    # print('{} {} {}'.format(head, tail, x))
    head += seg0
    tail += seg0
    points = []
    while(head <= tail):
        if(head == tail):
            points.append(head)
            break

        if(head % 2 ==1):
            points.append(head)
            head += 1
        head = head//2

        if(tail % 2 == 0):
            points.append(tail)
            tail -= 1
        tail = (tail-1)//2

    for point in points:
        seg[point] = min(seg[point], x) def update(head, tail, x):
    # print('{} {} {}'.format(head, tail, x))
    head += seg0
    tail += seg0
    points = []
    while(head <= tail):
        if(head == tail):
            points.append(head)
            break

        if(head % 2 ==1):
            points.append(head)
            head += 1
        head = head//2

        if(tail % 2 == 0):
            points.append(tail)
            tail -= 1
        tail = (tail-1)//2

    for point in points:
        seg[point] = min(seg[point], x) update b_right = bisect.bisect_right bisect.bisect_right b_right inf = 10**9 + 100 10**9 + 100 inf right = b_right(d, stx[i][1] - stx[i][2] -1) -1 b_right(d, stx[i][1] - stx[i][2] -1) -1 right def init(n,init_num=0):
    num = len(str(bin(n-1))) + 1
    seg = [init_num] * (2**num)
    # seg[0] = 2**(num-1)
    seg0 = 2**(num-1)
    return(seg,seg0) def init(n,init_num=0):
    num = len(str(bin(n-1))) + 1
    seg = [init_num] * (2**num)
    # seg[0] = 2**(num-1)
    seg0 = 2**(num-1)
    return(seg,seg0) init stx = [0]*n [0]*n stx def execute_all():
    for i in range(2,len(seg)):
        seg[i] = min(seg[i], seg[i//2]) def execute_all():
    for i in range(2,len(seg)):
        seg[i] = min(seg[i], seg[i//2]) execute_all q = map(int, input().split()) map(int, input().split()) q d = [0]*q [0]*q d seg,seg0 = init(q, init_num = inf) init(q, init_num = inf) seg
import sys
input = sys.stdin.readline

n,q = map(int, input().split())
# stx = [tuple(map(int, input().split())) for _ in range(n)]
stx = [0]*n
for i in range(n):
    stx[i] = tuple(map(int, input().split()))
# d = [int(input()) for _ in range(q)]
d = [0]*q
for i in range(q):
    d[i] = int(input())

#これはセグ木 * bisect
import bisect
inf = 10**9 + 100

# 定数倍高速化
b_left = bisect.bisect_left
b_right = bisect.bisect_right

def init(n,init_num=0):
    num = len(str(bin(n-1))) + 1
    seg = [init_num] * (2**num)
    # seg[0] = 2**(num-1)
    seg0 = 2**(num-1)
    return(seg,seg0)

def update(head, tail, x):
    # print('{} {} {}'.format(head, tail, x))
    head += seg0
    tail += seg0
    points = []
    while(head <= tail):
        if(head == tail):
            points.append(head)
            break

        if(head % 2 ==1):
            points.append(head)
            head += 1
        head = head//2

        if(tail % 2 == 0):
            points.append(tail)
            tail -= 1
        tail = (tail-1)//2

    for point in points:
        seg[point] = min(seg[point], x)

def execute_all():
    for i in range(2,len(seg)):
        seg[i] = min(seg[i], seg[i//2])


seg,seg0 = init(q, init_num = inf)

for i in range(n):
    left = b_left(d, stx[i][0] -stx[i][2])
    right = b_right(d, stx[i][1] - stx[i][2] -1) -1
    update(left, right, stx[i][2])
    # print('{} {} {}'.format(left, right, stx[i][2]))

execute_all()

for i in seg[seg0: seg0 + q]:
    if(i == inf):
        print(-1)
    else:
        print(i)