# https://atcoder.jp/contests/abc128/submissions/11722664

def main():
    from collections import deque, namedtuple
    from heapq import heappush, heappop
    from operator import attrgetter
    import sys

    input = sys.stdin.readline
    Event = namedtuple('Event', 'pos start end')
    UC = namedtuple('UC', 'pos end')  # UnderConstruction

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

    events = []
    for _ in range(N):
        s, t, x = map(int, input().split())
        e = Event(pos=x, start=s - x, end=t - x)  # 時間[s-x,t-x)にpos=0にいるとpos=xで工事中
        events.append(e)
    events.sort(key=attrgetter('start'))
    events = deque(events)

    D = (int(input()) for _ in range(Q))

    ans = []
    h = []
    for d in D:
        while events and events[0].start <= d:
            e = events.popleft()
            heappush(h, UC(pos=e.pos, end=e.end))

        while h and h[0].end <= d:
            heappop(h)

        ans.append(h[0].pos if h else -1)

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


if __name__ == '__main__':
    main() def main():
    from collections import deque, namedtuple
    from heapq import heappush, heappop
    from operator import attrgetter
    import sys

    input = sys.stdin.readline
    Event = namedtuple('Event', 'pos start end')
    UC = namedtuple('UC', 'pos end')  # UnderConstruction

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

    events = []
    for _ in range(N):
        s, t, x = map(int, input().split())
        e = Event(pos=x, start=s - x, end=t - x)  # 時間[s-x,t-x)にpos=0にいるとpos=xで工事中
        events.append(e)
    events.sort(key=attrgetter('start'))
    events = deque(events)

    D = (int(input()) for _ in range(Q))

    ans = []
    h = []
    for d in D:
        while events and events[0].start <= d:
            e = events.popleft()
            heappush(h, UC(pos=e.pos, end=e.end))

        while h and h[0].end <= d:
            heappop(h)

        ans.append(h[0].pos if h else -1)

    print(*ans, sep='\n') main from collections import deque, namedtuple from heapq import heappush, heappop from operator import attrgetter import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline Event = namedtuple('Event', 'pos start end') Event namedtuple('Event', 'pos start end') namedtuple 'Event' 'pos start end' UC = namedtuple('UC', 'pos end') UC namedtuple('UC', 'pos end') namedtuple 'UC' 'pos end' N, Q = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split Q events = [] events [] for _ in range(N):
        s, t, x = map(int, input().split())
        e = Event(pos=x, start=s - x, end=t - x)  # 時間[s-x,t-x)にpos=0にいるとpos=xで工事中
        events.append(e)
     _ 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 = Event(pos=x, start=s - x, end=t - x) e Event(pos=x, start=s - x, end=t - x) Event pos=x pos x start=s - x start s - x s x end=t - x end t - x t x events.append(e) events.append events append e events.sort(key=attrgetter('start')) events.sort events sort key=attrgetter('start') key attrgetter('start') attrgetter 'start' events = deque(events) events deque(events) deque events int(input()) for _ in range(Q) for _ in range(Q) _ range(Q) range Q for _ in range(Q) int(input()) int input() input D = (int(input()) for _ in range(Q)) D (int(input()) for _ in range(Q)) ans = [] ans [] h = [] h [] for d in D:
        while events and events[0].start <= d:
            e = events.popleft()
            heappush(h, UC(pos=e.pos, end=e.end))

        while h and h[0].end <= d:
            heappop(h)

        ans.append(h[0].pos if h else -1)

     d D while events and events[0].start <= d:
            e = events.popleft()
            heappush(h, UC(pos=e.pos, end=e.end))

         events and events[0].start <= d events events[0].start <= d events[0].start [0] events 0 start d e = events.popleft() e events.popleft() events.popleft events popleft heappush(h, UC(pos=e.pos, end=e.end)) heappush h UC(pos=e.pos, end=e.end) UC pos=e.pos pos e.pos e pos end=e.end end e.end e end while h and h[0].end <= d:
            heappop(h)

         h and h[0].end <= d h h[0].end <= d h[0].end [0] h 0 end d heappop(h) heappop h ans.append(h[0].pos if h else -1) ans.append ans append h[0].pos if h else -1 h h[0].pos [0] h 0 pos -1 print(*ans, sep='\n') print *ans ans sep='\n' sep '\n' if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    from collections import deque, namedtuple
    from heapq import heappush, heappop
    from operator import attrgetter
    import sys

    input = sys.stdin.readline
    Event = namedtuple('Event', 'pos start end')
    UC = namedtuple('UC', 'pos end')  # UnderConstruction

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

    events = []
    for _ in range(N):
        s, t, x = map(int, input().split())
        e = Event(pos=x, start=s - x, end=t - x)  # 時間[s-x,t-x)にpos=0にいるとpos=xで工事中
        events.append(e)
    events.sort(key=attrgetter('start'))
    events = deque(events)

    D = (int(input()) for _ in range(Q))

    ans = []
    h = []
    for d in D:
        while events and events[0].start <= d:
            e = events.popleft()
            heappush(h, UC(pos=e.pos, end=e.end))

        while h and h[0].end <= d:
            heappop(h)

        ans.append(h[0].pos if h else -1)

    print(*ans, sep='\n') def main():
    from collections import deque, namedtuple
    from heapq import heappush, heappop
    from operator import attrgetter
    import sys

    input = sys.stdin.readline
    Event = namedtuple('Event', 'pos start end')
    UC = namedtuple('UC', 'pos end')  # UnderConstruction

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

    events = []
    for _ in range(N):
        s, t, x = map(int, input().split())
        e = Event(pos=x, start=s - x, end=t - x)  # 時間[s-x,t-x)にpos=0にいるとpos=xで工事中
        events.append(e)
    events.sort(key=attrgetter('start'))
    events = deque(events)

    D = (int(input()) for _ in range(Q))

    ans = []
    h = []
    for d in D:
        while events and events[0].start <= d:
            e = events.popleft()
            heappush(h, UC(pos=e.pos, end=e.end))

        while h and h[0].end <= d:
            heappop(h)

        ans.append(h[0].pos if h else -1)

    print(*ans, sep='\n') main
# https://atcoder.jp/contests/abc128/submissions/11722664

def main():
    from collections import deque, namedtuple
    from heapq import heappush, heappop
    from operator import attrgetter
    import sys

    input = sys.stdin.readline
    Event = namedtuple('Event', 'pos start end')
    UC = namedtuple('UC', 'pos end')  # UnderConstruction

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

    events = []
    for _ in range(N):
        s, t, x = map(int, input().split())
        e = Event(pos=x, start=s - x, end=t - x)  # 時間[s-x,t-x)にpos=0にいるとpos=xで工事中
        events.append(e)
    events.sort(key=attrgetter('start'))
    events = deque(events)

    D = (int(input()) for _ in range(Q))

    ans = []
    h = []
    for d in D:
        while events and events[0].start <= d:
            e = events.popleft()
            heappush(h, UC(pos=e.pos, end=e.end))

        while h and h[0].end <= d:
            heappop(h)

        ans.append(h[0].pos if h else -1)

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


if __name__ == '__main__':
    main()
