from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

N, Q = map(int, input().split())

events = []
for i in range(N):
    S, T, X = map(int, input().split())
    events.append([S-X-0.5, 1, X])
    events.append([T-X-0.5, -1, X])

for i in range(Q):
    d = int(input())
    events.append([d, 0, i])

events = sorted(events)

count = defaultdict(int)
Xheap = []
heapq.heapify(Xheap)
ans = [-1 for i in range(Q)]

for e in events:
    if e[1] == 1:
        heapq.heappush(Xheap, e[2])
        count[e[2]] += 1
    elif e[1] == -1:
        count[e[2]] -= 1
    else:
        while Xheap:
            a = Xheap[0]
            if count[a] == 0:
                heapq.heappop(Xheap)
            else:
                ans[e[2]] = a
                break

for i in range(Q):
    print(ans[i]) from sys import stdin import sys sys import math math from functools import reduce import functools functools import itertools itertools from collections import deque,Counter,defaultdict from operator import mul import copy copy import heapq heapq sys.setrecursionlimit(10**6) sys.setrecursionlimit sys setrecursionlimit 10**6 10 6 INF = 10**18 INF 10**18 10 18 import bisect bisect import statistics statistics mod = 10**9+7 mod 10**9+7 10**9 10 9 7 N, Q = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split Q events = [] events [] for i in range(N):
    S, T, X = map(int, input().split())
    events.append([S-X-0.5, 1, X])
    events.append([T-X-0.5, -1, X]) 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 events.append([S-X-0.5, 1, X]) events.append events append [S-X-0.5, 1, X] S-X-0.5 S-X S X 0.5 1 X events.append([T-X-0.5, -1, X]) events.append events append [T-X-0.5, -1, X] T-X-0.5 T-X T X 0.5 -1 X for i in range(Q):
    d = int(input())
    events.append([d, 0, i]) i range(Q) range Q d = int(input()) d int(input()) int input() input events.append([d, 0, i]) events.append events append [d, 0, i] d 0 i events = sorted(events) events sorted(events) sorted events count = defaultdict(int) count defaultdict(int) defaultdict int Xheap = [] Xheap [] heapq.heapify(Xheap) heapq.heapify heapq heapify Xheap -1 for i in range(Q) for i in range(Q) i range(Q) range Q for i in range(Q) -1 ans = [-1 for i in range(Q)] ans [-1 for i in range(Q)] for e in events:
    if e[1] == 1:
        heapq.heappush(Xheap, e[2])
        count[e[2]] += 1
    elif e[1] == -1:
        count[e[2]] -= 1
    else:
        while Xheap:
            a = Xheap[0]
            if count[a] == 0:
                heapq.heappop(Xheap)
            else:
                ans[e[2]] = a
                break e events if e[1] == 1:
        heapq.heappush(Xheap, e[2])
        count[e[2]] += 1
    elif e[1] == -1:
        count[e[2]] -= 1
    else:
        while Xheap:
            a = Xheap[0]
            if count[a] == 0:
                heapq.heappop(Xheap)
            else:
                ans[e[2]] = a
                break e[1] == 1 e[1] e 1 1 heapq.heappush(Xheap, e[2]) heapq.heappush heapq heappush Xheap e[2] e 2 count[e[2]] += 1 count[e[2]] count e[2] e 2 1 elif e[1] == -1:
        count[e[2]] -= 1
     e[1] == -1 e[1] e 1 -1 count[e[2]] -= 1 count[e[2]] count e[2] e 2 1 while Xheap:
            a = Xheap[0]
            if count[a] == 0:
                heapq.heappop(Xheap)
            else:
                ans[e[2]] = a
                break Xheap a = Xheap[0] a Xheap[0] Xheap 0 if count[a] == 0:
                heapq.heappop(Xheap)
            else:
                ans[e[2]] = a
                break count[a] == 0 count[a] count a 0 heapq.heappop(Xheap) heapq.heappop heapq heappop Xheap ans[e[2]] = a ans[e[2]] ans e[2] e 2 a break for i in range(Q):
    print(ans[i]) i range(Q) range Q print(ans[i]) print ans[i] ans i T, X = map(int, input().split()) map(int, input().split()) T Q = map(int, input().split()) map(int, input().split()) Q INF = 10**18 10**18 INF N, Q = map(int, input().split()) map(int, input().split()) N a = Xheap[0] Xheap[0] a events = sorted(events) sorted(events) events mod = 10**9+7 10**9+7 mod ans = [-1 for i in range(Q)] [-1 for i in range(Q)] ans X = map(int, input().split()) map(int, input().split()) X d = int(input()) int(input()) d events = [] [] events count = defaultdict(int) defaultdict(int) count Xheap = [] [] Xheap S, T, X = map(int, input().split()) map(int, input().split()) S
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

N, Q = map(int, input().split())

events = []
for i in range(N):
    S, T, X = map(int, input().split())
    events.append([S-X-0.5, 1, X])
    events.append([T-X-0.5, -1, X])

for i in range(Q):
    d = int(input())
    events.append([d, 0, i])

events = sorted(events)

count = defaultdict(int)
Xheap = []
heapq.heapify(Xheap)
ans = [-1 for i in range(Q)]

for e in events:
    if e[1] == 1:
        heapq.heappush(Xheap, e[2])
        count[e[2]] += 1
    elif e[1] == -1:
        count[e[2]] -= 1
    else:
        while Xheap:
            a = Xheap[0]
            if count[a] == 0:
                heapq.heappop(Xheap)
            else:
                ans[e[2]] = a
                break

for i in range(Q):
    print(ans[i])