# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

input = sys.stdin.readline

sys.setrecursionlimit(100000)


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, Q, STX, D):
    E = []
    for i, (s, t, x) in enumerate(STX):
        E.append((s-x, 1, x, i))
        E.append((t-x, -1, x, i))
    E.sort(reverse=True)

    q = []
    done = set()
    ans = [-1] * Q
    for j, d in enumerate(D):
        while E and E[-1][0] <= d:
            t, e, x, i = E.pop()
            if e == 1:
                heapq.heappush(q, (x, i))
            else:
                done.add((x, i))

        while q and q[0] in done:
            done.remove(heapq.heappop(q))

        if q:
            ans[j] = q[0][0]

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


def main():
    N, Q = read_int_n()
    STX = list(read_int_n() for _ in range(N))
    D = list(read_int() for _ in range(Q))
    (slv(N, Q, STX, D))


if __name__ == '__main__':
    main() import bisect bisect import heapq heapq import math math import random random import sys sys from collections import Counter, defaultdict, deque from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal from functools import lru_cache, reduce from itertools import combinations, combinations_with_replacement, product, permutations from operator import add, mul, sub input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline sys.setrecursionlimit(100000) sys.setrecursionlimit sys setrecursionlimit 100000 def read_int():
    return int(input()) read_int return int(input()) int(input()) int input() input def read_int_n():
    return list(map(int, input().split())) read_int_n return list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def read_float():
    return float(input()) read_float return float(input()) float(input()) float input() input def read_float_n():
    return list(map(float, input().split())) read_float_n return list(map(float, input().split())) list(map(float, input().split())) list map(float, input().split()) map float input().split() ().split () input split def read_str():
    return input().strip() read_str return input().strip() input().strip() ().strip () input strip def read_str_n():
    return list(map(str, input().split())) read_str_n return list(map(str, input().split())) list(map(str, input().split())) list map(str, input().split()) map str input().split() ().split () input split def error_print(*args):
    print(*args, file=sys.stderr) error_print print(*args, file=sys.stderr) print *args args file=sys.stderr file sys.stderr sys stderr *args def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap mt import time time def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

     wrap s = time.time() s time.time() time.time time time ret = f(*args, **kwargs) ret f(*args, **kwargs) f *args args **kwargs kwargs e = time.time() e time.time() time.time time time error_print(e - s, 'sec') error_print e - s e s 'sec' return ret ret *args **kwargs return wrap wrap f f def slv(N, Q, STX, D):
    E = []
    for i, (s, t, x) in enumerate(STX):
        E.append((s-x, 1, x, i))
        E.append((t-x, -1, x, i))
    E.sort(reverse=True)

    q = []
    done = set()
    ans = [-1] * Q
    for j, d in enumerate(D):
        while E and E[-1][0] <= d:
            t, e, x, i = E.pop()
            if e == 1:
                heapq.heappush(q, (x, i))
            else:
                done.add((x, i))

        while q and q[0] in done:
            done.remove(heapq.heappop(q))

        if q:
            ans[j] = q[0][0]

    for i in range(Q):
        print(ans[i]) slv E = [] E [] for i, (s, t, x) in enumerate(STX):
        E.append((s-x, 1, x, i))
        E.append((t-x, -1, x, i))
     i (s, t, x) s t x enumerate(STX) enumerate STX E.append((s-x, 1, x, i)) E.append E append (s-x, 1, x, i) s-x s x 1 x i E.append((t-x, -1, x, i)) E.append E append (t-x, -1, x, i) t-x t x -1 x i E.sort(reverse=True) E.sort E sort reverse=True reverse True q = [] q [] done = set() done set() set ans = [-1] * Q ans [-1] * Q [-1] -1 Q for j, d in enumerate(D):
        while E and E[-1][0] <= d:
            t, e, x, i = E.pop()
            if e == 1:
                heapq.heappush(q, (x, i))
            else:
                done.add((x, i))

        while q and q[0] in done:
            done.remove(heapq.heappop(q))

        if q:
            ans[j] = q[0][0]

     j d enumerate(D) enumerate D while E and E[-1][0] <= d:
            t, e, x, i = E.pop()
            if e == 1:
                heapq.heappush(q, (x, i))
            else:
                done.add((x, i))

         E and E[-1][0] <= d E E[-1][0] <= d E[-1][0] [-1] E -1 0 d t, e, x, i = E.pop() t E.pop() E.pop E pop e x i if e == 1:
                heapq.heappush(q, (x, i))
            else:
                done.add((x, i))

         e == 1 e 1 heapq.heappush(q, (x, i)) heapq.heappush heapq heappush q (x, i) x i done.add((x, i)) done.add done add (x, i) x i while q and q[0] in done:
            done.remove(heapq.heappop(q))

         q and q[0] in done q q[0] in done q[0] q 0 done done.remove(heapq.heappop(q)) done.remove done remove heapq.heappop(q) heapq.heappop heapq heappop q if q:
            ans[j] = q[0][0]

     q ans[j] = q[0][0] ans[j] ans j q[0][0] [0] q 0 0 for i in range(Q):
        print(ans[i]) i range(Q) range Q print(ans[i]) print ans[i] ans i N N Q Q STX STX D D @mt slv mt slv def main():
    N, Q = read_int_n()
    STX = list(read_int_n() for _ in range(N))
    D = list(read_int() for _ in range(Q))
    (slv(N, Q, STX, D)) main N, Q = read_int_n() N read_int_n() read_int_n Q STX = list(read_int_n() for _ in range(N)) STX list(read_int_n() for _ in range(N)) list read_int_n() read_int_n D = list(read_int() for _ in range(Q)) D list(read_int() for _ in range(Q)) list read_int() read_int slv(N, Q, STX, D) slv N Q STX D if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main input = sys.stdin.readline sys.stdin.readline input def read_float_n():
    return list(map(float, input().split())) def read_float_n():
    return list(map(float, input().split())) read_float_n def read_str():
    return input().strip() def read_str():
    return input().strip() read_str def main():
    N, Q = read_int_n()
    STX = list(read_int_n() for _ in range(N))
    D = list(read_int() for _ in range(Q))
    (slv(N, Q, STX, D)) def main():
    N, Q = read_int_n()
    STX = list(read_int_n() for _ in range(N))
    D = list(read_int() for _ in range(Q))
    (slv(N, Q, STX, D)) main def read_int_n():
    return list(map(int, input().split())) def read_int_n():
    return list(map(int, input().split())) read_int_n def slv(N, Q, STX, D):
    E = []
    for i, (s, t, x) in enumerate(STX):
        E.append((s-x, 1, x, i))
        E.append((t-x, -1, x, i))
    E.sort(reverse=True)

    q = []
    done = set()
    ans = [-1] * Q
    for j, d in enumerate(D):
        while E and E[-1][0] <= d:
            t, e, x, i = E.pop()
            if e == 1:
                heapq.heappush(q, (x, i))
            else:
                done.add((x, i))

        while q and q[0] in done:
            done.remove(heapq.heappop(q))

        if q:
            ans[j] = q[0][0]

    for i in range(Q):
        print(ans[i]) def slv(N, Q, STX, D):
    E = []
    for i, (s, t, x) in enumerate(STX):
        E.append((s-x, 1, x, i))
        E.append((t-x, -1, x, i))
    E.sort(reverse=True)

    q = []
    done = set()
    ans = [-1] * Q
    for j, d in enumerate(D):
        while E and E[-1][0] <= d:
            t, e, x, i = E.pop()
            if e == 1:
                heapq.heappush(q, (x, i))
            else:
                done.add((x, i))

        while q and q[0] in done:
            done.remove(heapq.heappop(q))

        if q:
            ans[j] = q[0][0]

    for i in range(Q):
        print(ans[i]) slv def read_float():
    return float(input()) def read_float():
    return float(input()) read_float def error_print(*args):
    print(*args, file=sys.stderr) def error_print(*args):
    print(*args, file=sys.stderr) error_print def read_int():
    return int(input()) def read_int():
    return int(input()) read_int def read_str_n():
    return list(map(str, input().split())) def read_str_n():
    return list(map(str, input().split())) read_str_n def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap mt
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

input = sys.stdin.readline

sys.setrecursionlimit(100000)


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, Q, STX, D):
    E = []
    for i, (s, t, x) in enumerate(STX):
        E.append((s-x, 1, x, i))
        E.append((t-x, -1, x, i))
    E.sort(reverse=True)

    q = []
    done = set()
    ans = [-1] * Q
    for j, d in enumerate(D):
        while E and E[-1][0] <= d:
            t, e, x, i = E.pop()
            if e == 1:
                heapq.heappush(q, (x, i))
            else:
                done.add((x, i))

        while q and q[0] in done:
            done.remove(heapq.heappop(q))

        if q:
            ans[j] = q[0][0]

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


def main():
    N, Q = read_int_n()
    STX = list(read_int_n() for _ in range(N))
    D = list(read_int() for _ in range(Q))
    (slv(N, Q, STX, D))


if __name__ == '__main__':
    main()
