from operator import itemgetter
import sys

input = sys.stdin.readline
inf = float('inf')

n, q = map(int, input().split())

e = []
for _ in range(n):
    s, t, x = map(int, input().split())
    # 区間[s, t)に通行止め
    e.append((s - x, x, 0))  # 通行止め開始
    e.append((t - x - 0.5, x, 1))  # 通行止め解除
e.sort(key=itemgetter(0))

stop_set = set()
stop_at = inf
cur = 0
for _ in range(q):
    changed = False
    d = int(input())
    while cur < n * 2:
        exec_time, pos, typ = e[cur]
        if exec_time <= d:
            if typ == 0:
                stop_set.add(pos)
                if (not changed) and (pos < stop_at):
                    stop_at = pos
            else:
                stop_set.remove(pos)
                if (not changed) and (pos == stop_at):
                    changed = True
            cur += 1
        else:
            break

    if changed:
        if stop_set:
            stop_at = min(stop_set)
        else:
            stop_at = inf

    print(stop_at if stop_at != inf else -1) from operator import itemgetter import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline inf = float('inf') inf float('inf') float 'inf' n, q = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split q e = [] e [] for _ in range(n):
    s, t, x = map(int, input().split())
    # 区間[s, t)に通行止め
    e.append((s - x, x, 0))  # 通行止め開始
    e.append((t - x - 0.5, x, 1))  # 通行止め解除 _ 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 e.append((s - x, x, 0)) e.append e append (s - x, x, 0) s - x s x x 0 e.append((t - x - 0.5, x, 1)) e.append e append (t - x - 0.5, x, 1) t - x - 0.5 t - x t x 0.5 x 1 e.sort(key=itemgetter(0)) e.sort e sort key=itemgetter(0) key itemgetter(0) itemgetter 0 stop_set = set() stop_set set() set stop_at = inf stop_at inf cur = 0 cur 0 for _ in range(q):
    changed = False
    d = int(input())
    while cur < n * 2:
        exec_time, pos, typ = e[cur]
        if exec_time <= d:
            if typ == 0:
                stop_set.add(pos)
                if (not changed) and (pos < stop_at):
                    stop_at = pos
            else:
                stop_set.remove(pos)
                if (not changed) and (pos == stop_at):
                    changed = True
            cur += 1
        else:
            break

    if changed:
        if stop_set:
            stop_at = min(stop_set)
        else:
            stop_at = inf

    print(stop_at if stop_at != inf else -1) _ range(q) range q changed = False changed False d = int(input()) d int(input()) int input() input while cur < n * 2:
        exec_time, pos, typ = e[cur]
        if exec_time <= d:
            if typ == 0:
                stop_set.add(pos)
                if (not changed) and (pos < stop_at):
                    stop_at = pos
            else:
                stop_set.remove(pos)
                if (not changed) and (pos == stop_at):
                    changed = True
            cur += 1
        else:
            break

     cur < n * 2 cur n * 2 n 2 exec_time, pos, typ = e[cur] exec_time e[cur] e cur pos typ if exec_time <= d:
            if typ == 0:
                stop_set.add(pos)
                if (not changed) and (pos < stop_at):
                    stop_at = pos
            else:
                stop_set.remove(pos)
                if (not changed) and (pos == stop_at):
                    changed = True
            cur += 1
        else:
            break

     exec_time <= d exec_time d if typ == 0:
                stop_set.add(pos)
                if (not changed) and (pos < stop_at):
                    stop_at = pos
            else:
                stop_set.remove(pos)
                if (not changed) and (pos == stop_at):
                    changed = True
             typ == 0 typ 0 stop_set.add(pos) stop_set.add stop_set add pos if (not changed) and (pos < stop_at):
                    stop_at = pos
             (not changed) and (pos < stop_at) not changed changed pos < stop_at pos stop_at stop_at = pos stop_at pos stop_set.remove(pos) stop_set.remove stop_set remove pos if (not changed) and (pos == stop_at):
                    changed = True
             (not changed) and (pos == stop_at) not changed changed pos == stop_at pos stop_at changed = True changed True cur += 1 cur 1 break if changed:
        if stop_set:
            stop_at = min(stop_set)
        else:
            stop_at = inf

     changed if stop_set:
            stop_at = min(stop_set)
        else:
            stop_at = inf

     stop_set stop_at = min(stop_set) stop_at min(stop_set) min stop_set stop_at = inf stop_at inf print(stop_at if stop_at != inf else -1) print stop_at if stop_at != inf else -1 stop_at != inf stop_at inf stop_at -1 cur += 1 1 cur input = sys.stdin.readline sys.stdin.readline input n, q = map(int, input().split()) map(int, input().split()) n e = [] [] e s, t, x = map(int, input().split()) map(int, input().split()) s typ = e[cur] e[cur] typ changed = True True changed exec_time, pos, typ = e[cur] e[cur] exec_time stop_set = set() set() stop_set stop_at = min(stop_set) min(stop_set) stop_at t, x = map(int, input().split()) map(int, input().split()) t x = map(int, input().split()) map(int, input().split()) x inf = float('inf') float('inf') inf q = map(int, input().split()) map(int, input().split()) q pos, typ = e[cur] e[cur] pos stop_at = inf inf stop_at d = int(input()) int(input()) d stop_at = pos pos stop_at stop_at = inf inf stop_at changed = False False changed cur = 0 0 cur
from operator import itemgetter
import sys

input = sys.stdin.readline
inf = float('inf')

n, q = map(int, input().split())

e = []
for _ in range(n):
    s, t, x = map(int, input().split())
    # 区間[s, t)に通行止め
    e.append((s - x, x, 0))  # 通行止め開始
    e.append((t - x - 0.5, x, 1))  # 通行止め解除
e.sort(key=itemgetter(0))

stop_set = set()
stop_at = inf
cur = 0
for _ in range(q):
    changed = False
    d = int(input())
    while cur < n * 2:
        exec_time, pos, typ = e[cur]
        if exec_time <= d:
            if typ == 0:
                stop_set.add(pos)
                if (not changed) and (pos < stop_at):
                    stop_at = pos
            else:
                stop_set.remove(pos)
                if (not changed) and (pos == stop_at):
                    changed = True
            cur += 1
        else:
            break

    if changed:
        if stop_set:
            stop_at = min(stop_set)
        else:
            stop_at = inf

    print(stop_at if stop_at != inf else -1)
