from bisect import bisect, bisect_left
from collections import Counter
from functools import reduce
from itertools import accumulate
from operator import itemgetter, xor

import sys
input = sys.stdin.readline

def inpl(): return list(map(int, input().split()))

class BIT:
    def __init__(self, N):
        # Nは入れたい要素の個数
        self.N = N
        self.tree = [0]*(self.N + 1)
        self.n = 1
        while self.n <= N:
            self.n *= 2
        self.n //= 2

    def sum(self, i):
        res = 0
        while i:
            res += self.tree[i]
            i -= (i & -(i))
        return res

    def add(self, i, x):
        if i == 0:
            return
        while i <= self.N:
            self.tree[i] += x
            i += (i & -(i))

    def lower_bound(self, val):
        if val <= 0:
            return 0
        res = 0
        k = self.n
        while k:
            if res + k <= self.N and self.tree[res + k] < val:
                val -= self.tree[res + k]
                res += k
            k //= 2
        return res + 1
            
class OfflineSortedSet:
	
    def __init__(self, all_vals):
        self.keys = sorted(set(all_vals))
        self.max_key = max(self.keys)
        self.key_to_index = {k:i for i, k in enumerate(self.keys, start=1)}
        self.keys_num = len(self.keys)

        self.bit = BIT(self.keys_num)
        self.hash_set = set()

        self.add_bit = self.bit.add
        self.sum_bit = self.bit.sum
        self.lower_bound_bit = self.bit.lower_bound
        self.add_hash_set = self.hash_set.add
        self.remove_hash_set = self.hash_set.remove

    def exists(self, val):
        return val in self.hash_set

    def add(self, val):
        if val in self.hash_set:
            return
        
        self.add_hash_set(val)
        self.add_bit(self.key_to_index[val], 1)

    def remove(self, val):
        if val not in self.hash_set:
            return

        self.remove_hash_set(val)
        self.add_bit(self.key_to_index[val], -1)

    def lower_bound(self, val):
        idx = bisect_left(self.keys, val)
        tar = self.sum_bit(idx)
        res = self.lower_bound_bit(tar + 1) - 1
        if res < 0 or res >= self.keys_num:
            res = self.keys_num
        return res

def main():
    N, Q = inpl()
    hoge = [inpl() for _ in range(N)]
    X = [0]*N

    v = [0]*(2*N)
    for i in range(N):
        s, t, X[i] = hoge[i]
        v[2*i] = (s - X[i], 1, X[i])
        v[2*i+1] = (t - X[i], -1, X[i])
    v = sorted(v)

    se = OfflineSortedSet(X)
    del X

    idx = 0
    D = [int(input()) for _ in range(Q)]
    ans = [0]*Q
    for i, d in enumerate(D):
        while idx < len(v):
            t, com, x = v[idx]
            if t > d:
                break
            if com == 1:
                se.add(x)
            else:
                se.remove(x)
            idx += 1
        ans[i] = -1 if len(se.hash_set) == 0 else se.keys[se.lower_bound(-10000000000)]
    print(*ans, sep="\n")
    
if __name__ == "__main__":
    main()
