import sys
input = sys.stdin.readline

n,Q=map(int,input().split())
bn = (n-1).bit_length()
b_num = 2**bn
mx = 10**9
segl=[mx]*2*b_num 

xs = []
for s, t, x in [[int(c) for c in input().split()] for _ in range(n)]:
    xs += [(s-x,0,x,i), (t-x,1,x,i)]
for _ in range(Q):
    xs.append((int(input()),2,0,0))
xs.sort()
ys = set()
for x in xs:
    if x[1]==2:
        for _ in range(bn):
            nys = set()
            ys = nys
        print(segl[0] if segl[0]!= mx else -1)
        ys = set()
        continue
    segl[x[3]+b_num-1] = mx if x[1] else x[2]
    ys.add((x[3]+b_num-2)//2)
