import sys
input = sys.stdin.readline

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

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

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

def update(head, tail, x):
    # print('{} {} {}'.format(head, tail, x))
    head += seg[0]
    tail += seg[0]
    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(p):
    p += seg[0]
    tmp = seg[p]
    while(p > 0):
        p = p//2
        tmp = min(tmp, sep[p])
    return(tmp)

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


seg = init(q, init_num = inf)

for i in range(n):
    left = bisect.bisect_left(d, stx[i][0] -stx[i][2])
    right = bisect.bisect_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[seg[0]: seg[0] + 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 tuple(map(int, input().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) tuple(map(int, input().split())) tuple map(int, input().split()) map int input().split() ().split () input split stx = [tuple(map(int, input().split())) for _ in range(n)] stx [tuple(map(int, input().split())) for _ in range(n)] int(input()) for _ in range(q) for _ in range(q) _ range(q) range q for _ in range(q) int(input()) int input() input d = [int(input()) for _ in range(q)] d [int(input()) for _ in range(q)] import bisect bisect inf = 10**9 + 100 inf 10**9 + 100 10**9 10 9 100 def init(n,init_num=0):
    num = len(str(bin(n-1))) + 1
    seg = [init_num] * (2**num)
    seg[0] = 2**(num-1)
    return(seg) 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 seg[0] = 2**(num-1) seg[0] seg 0 2**(num-1) 2 num-1 num 1 return(seg) seg n n init_num=0 init_num 0 def update(head, tail, x):
    # print('{} {} {}'.format(head, tail, x))
    head += seg[0]
    tail += seg[0]
    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 += seg[0] head seg[0] seg 0 tail += seg[0] tail seg[0] seg 0 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(p):
    p += seg[0]
    tmp = seg[p]
    while(p > 0):
        p = p//2
        tmp = min(tmp, sep[p])
    return(tmp) execute p += seg[0] p seg[0] seg 0 tmp = seg[p] tmp seg[p] seg p while(p > 0):
        p = p//2
        tmp = min(tmp, sep[p])
     p > 0 p 0 p = p//2 p p//2 p 2 tmp = min(tmp, sep[p]) tmp min(tmp, sep[p]) min tmp sep[p] sep p return(tmp) tmp p p 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 = init(q, init_num = inf) seg init(q, init_num = inf) init q init_num = inf init_num inf for i in range(n):
    left = bisect.bisect_left(d, stx[i][0] -stx[i][2])
    right = bisect.bisect_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 = bisect.bisect_left(d, stx[i][0] -stx[i][2]) left bisect.bisect_left(d, stx[i][0] -stx[i][2]) bisect.bisect_left bisect bisect_left d stx[i][0] -stx[i][2] stx[i][0] [i] stx i 0 stx[i][2] [i] stx i 2 right = bisect.bisect_right(d, stx[i][1] - stx[i][2] -1) -1 right bisect.bisect_right(d, stx[i][1] - stx[i][2] -1) -1 bisect.bisect_right(d, stx[i][1] - stx[i][2] -1) bisect.bisect_right bisect bisect_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[seg[0]: seg[0] + q]:
    if(i == inf):
        print(-1)
    else:
        print(i) i seg[seg[0]: seg[0] + q] seg seg[0]: seg[0] + q seg[0] seg 0 seg[0] + q seg[0] seg 0 q if(i == inf):
        print(-1)
    else:
        print(i) i == inf i inf print(-1) print -1 print(i) print i def execute(p):
    p += seg[0]
    tmp = seg[p]
    while(p > 0):
        p = p//2
        tmp = min(tmp, sep[p])
    return(tmp) def execute(p):
    p += seg[0]
    tmp = seg[p]
    while(p > 0):
        p = p//2
        tmp = min(tmp, sep[p])
    return(tmp) execute right = bisect.bisect_right(d, stx[i][1] - stx[i][2] -1) -1 bisect.bisect_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)
    return(seg) def init(n,init_num=0):
    num = len(str(bin(n-1))) + 1
    seg = [init_num] * (2**num)
    seg[0] = 2**(num-1)
    return(seg) init d = [int(input()) for _ in range(q)] [int(input()) for _ in range(q)] d left = bisect.bisect_left(d, stx[i][0] -stx[i][2]) bisect.bisect_left(d, stx[i][0] -stx[i][2]) left q = map(int, input().split()) map(int, input().split()) q input = sys.stdin.readline sys.stdin.readline input n,q = map(int, input().split()) map(int, input().split()) n def update(head, tail, x):
    # print('{} {} {}'.format(head, tail, x))
    head += seg[0]
    tail += seg[0]
    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 += seg[0]
    tail += seg[0]
    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 stx = [tuple(map(int, input().split())) for _ in range(n)] [tuple(map(int, input().split())) for _ in range(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 inf = 10**9 + 100 10**9 + 100 inf seg = 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)]
d = [int(input()) for _ in range(q)]

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

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

def update(head, tail, x):
    # print('{} {} {}'.format(head, tail, x))
    head += seg[0]
    tail += seg[0]
    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(p):
    p += seg[0]
    tmp = seg[p]
    while(p > 0):
        p = p//2
        tmp = min(tmp, sep[p])
    return(tmp)

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


seg = init(q, init_num = inf)

for i in range(n):
    left = bisect.bisect_left(d, stx[i][0] -stx[i][2])
    right = bisect.bisect_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[seg[0]: seg[0] + q]:
    if(i == inf):
        print(-1)
    else:
        print(i)