### BUGGY CODE ###

import bisect
import sys
input = sys.stdin.readline


class LazyPropSegmentTree:
    def __init__(self, a):
        self.padding = float('inf')        
        self.n = len(a)
        self.N = 1 << (self.n-1).bit_length()
        self.seg_data = [self.padding]*(self.N-1) + a + [self.padding]*(self.N-self.n)
        self.lazy = [None] * (2*self.N - 1)
        for i in range(2*self.N-2, 0, -2):
            self.seg_data[(i-1)>>1] = min(self.seg_data[i], self.seg_data[i-1])
    
    def __len__(self):
        return self.n
    
    def indices_generator(self, i, j):
        # [i, j)
        # [idx1, idx2)を部分的に含むインデックスを降順にyieldするジェネレータ
        idx1 = self.N + i
        idx2 = self.N + j
        lm = (idx1 // (idx1 & -idx1)) >> 1
        rm = (idx2 // (idx2 & -idx2)) >> 1
        while 0 < idx1 < idx2:
            if idx2 <= rm:
                yield idx2-1
            if idx1 <= lm:
                yield idx1-1
            idx1 >>= 1
            idx2 >>= 1
        while idx1:
            yield idx1-1
            idx1 >>= 1
    
    def propagate_down(self, indices):
        # 遅延させていた値を伝搬させる
        # indicesは昇順
        for idx in indices:
            v = self.lazy[idx]
            if v is not None:
                idx1, idx2 = 2*idx + 1, 2*idx + 2
                self.lazy[idx1] = self.lazy[idx2] = v
                self.seg_data[idx1] = self.seg_data[idx2] = v
                self.lazy[idx] = None
    
    def propagate_up(self, indices):
        for idx in indices:
            idx1, idx2 = 2*idx + 1, 2*idx + 2
            self.seg_data[idx] = min(self.seg_data[idx1], self.seg_data[idx2])

    def propagate_all(self):
        indices = [i for i in range(self.N-1)]
        self.propagate_down(indices)
        self.propagate_up(indices[::-1])
    
    def update(self, i, j, x):
        # [i, j)の区間の値をxに変更する
        *should_prop, = self.indices_generator(i, j)
        self.propagate_down(should_prop[::-1])
        idx1 = self.N - 1 + i
        idx2 = self.N - 2 + j
        while idx1 < idx2 + 1:
            if idx1&1 == 0: # idx1が偶数
                self.lazy[idx1] = self.seg_data[idx1] = x
            if idx2&1 == 1: # idx2が奇数
                self.lazy[idx2] = self.seg_data[idx2] = x
            idx1 >>= 1
            idx2 >>= 1
            idx2 -= 1
        self.propagate_up(should_prop)
    
    def query(self, i, j):
        # [i, j)
        *should_prop, = self.indices_generator(i, j)
        self.propagate_down(should_prop[::-1])
        idx1 = self.N - 1 + i
        idx2 = self.N - 2 + j
        result = self.padding
        while idx1 < idx2 + 1:
                if idx1&1 == 0: # idx1が偶数
                    result = min(result, self.seg_data[idx1])
                if idx2&1 == 1: # idx2が奇数
                    result = min(result, self.seg_data[idx2])                
                idx1 >>= 1
                idx2 >>= 1
                idx2 -= 1
        return result
    
    @property
    def data(self):
        return self.seg_data[self.N-1:self.N-1+self.n]
    

INF = float('inf')
N, Q = map(int, input().split())
STX = [list(map(int, input().split())) for i in range(N)]
STX.sort(key=lambda x:x[2], reverse=True)
st = LazyPropSegmentTree([INF]*Q)
d = [int(input()) for i in range(Q)]

for s, t, x in STX:
  il = bisect.bisect_left(d, s-x)
  ir = bisect.bisect_right(d, t-x-1)
  if il == ir:
    continue
  st.update(il, ir, x)

st.propagate_down([i for i in range(st.N-1)])
ans = [x if x<INF else -1 for x in st.data]
print(*ans, sep='\n')

### FIXED CODE ###

import sys
from heapq import heappop, heappush

input = sys.stdin.readline
N, Q = map(int, input().split())
event_list = []
for i in range(N):
  s, t, x = map(int, input().split())
  event_list.append([s-x, 1, x])
  event_list.append([t-x, -1, x])

for i in range(Q):
  event_list.append([int(input()), 2, 0])

ans = []
event_list.sort()
x_set = set()
x_list = []
for time, event, x in event_list:
  if event == 1:
    x_set.add(x)
    heappush(x_list, x)
  elif event == -1:
    x_set.remove(x)
  else:
    while x_list and x_list[0] not in x_set:
      heappop(x_list)
    if x_list:
      ans.append(x_list[0])
    else:
      ans.append(-1)

print(*ans, sep='\n')