#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 15 16:58:00 2019

@author: YudNK
"""
import bisect as bs

N, Q = map(int, input().split())
E = []
for i in range(N):
    s, t, x = map(int, input().split())
    a = [s - x, t - x, x] #イベント
    E.append(a)
E.sort(key = lambda x: x[2])
D = []
for i in range(Q):
    D.append(int(input()))

ans = [-1]*Q
check = [-1]*Q

for e in E:
    l = bs.bisect_left(D, e[0])
    r = bs.bisect_left(D, e[1])
    while l < r:
        if check[l] == -1:  
            ans[l] = e[2]
            check[l] = r
            l += 1
        else:
            l = check[l]
        
[print(i) for i in ans] """
Created on Sat Jun 15 16:58:00 2019

@author: YudNK
""" import bisect as bs bisect N, Q = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split Q E = [] E [] for i in range(N):
    s, t, x = map(int, input().split())
    a = [s - x, t - x, x] #イベント
    E.append(a) i range(N) range N s, t, x = map(int, input().split()) s map(int, input().split()) map int input().split() ().split () input split t x a = [s - x, t - x, x] a [s - x, t - x, x] s - x s x t - x t x x E.append(a) E.append E append a E.sort(key = lambda x: x[2]) E.sort E sort key = lambda x: x[2] key lambda x: x[2] x[2] x 2 x D = [] D [] for i in range(Q):
    D.append(int(input())) i range(Q) range Q D.append(int(input())) D.append D append int(input()) int input() input ans = [-1]*Q ans [-1]*Q [-1] -1 Q check = [-1]*Q check [-1]*Q [-1] -1 Q for e in E:
    l = bs.bisect_left(D, e[0])
    r = bs.bisect_left(D, e[1])
    while l < r:
        if check[l] == -1:  
            ans[l] = e[2]
            check[l] = r
            l += 1
        else:
            l = check[l]
         e E l = bs.bisect_left(D, e[0]) l bs.bisect_left(D, e[0]) bs.bisect_left bs bisect_left D e[0] e 0 r = bs.bisect_left(D, e[1]) r bs.bisect_left(D, e[1]) bs.bisect_left bs bisect_left D e[1] e 1 while l < r:
        if check[l] == -1:  
            ans[l] = e[2]
            check[l] = r
            l += 1
        else:
            l = check[l]
         l < r l r if check[l] == -1:  
            ans[l] = e[2]
            check[l] = r
            l += 1
        else:
            l = check[l]
         check[l] == -1 check[l] check l -1 ans[l] = e[2] ans[l] ans l e[2] e 2 check[l] = r check[l] check l r l += 1 l 1 l = check[l] l check[l] check l print(i) for i in ans for i in ans i ans for i in ans print(i) print i [print(i) for i in ans] t, x = map(int, input().split()) map(int, input().split()) t l = check[l] check[l] l x = map(int, input().split()) map(int, input().split()) x D = [] [] D ans = [-1]*Q [-1]*Q ans N, Q = map(int, input().split()) map(int, input().split()) N s, t, x = map(int, input().split()) map(int, input().split()) s E = [] [] E a = [s - x, t - x, x] [s - x, t - x, x] a check = [-1]*Q [-1]*Q check l = bs.bisect_left(D, e[0]) bs.bisect_left(D, e[0]) l l += 1 1 l r = bs.bisect_left(D, e[1]) bs.bisect_left(D, e[1]) r Q = map(int, input().split()) map(int, input().split()) Q
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 15 16:58:00 2019

@author: YudNK
"""
import bisect as bs

N, Q = map(int, input().split())
E = []
for i in range(N):
    s, t, x = map(int, input().split())
    a = [s - x, t - x, x] #イベント
    E.append(a)
E.sort(key = lambda x: x[2])
D = []
for i in range(Q):
    D.append(int(input()))

ans = [-1]*Q
check = [-1]*Q

for e in E:
    l = bs.bisect_left(D, e[0])
    r = bs.bisect_left(D, e[1])
    while l < r:
        if check[l] == -1:  
            ans[l] = e[2]
            check[l] = r
            l += 1
        else:
            l = check[l]
        
[print(i) for i in ans]