import sys;input=sys.stdin.readline

n,q=map(int, input().split())
event=[]
for _ in range(n):
    s,t,x=map(int,input().split())
    event.append((s-x-0.5,1,x))
    event.append((t-x-0.5,-1,x))
for i in range(q):
    event.append((int(input()),0,i))

event.sort()
is_stop=False
stop=set()
minstop=float('inf')
ans=[-1]*q
for t,e,x in event:
    if e > 0:
        stop.add(x)
        if x<minstop:
            minstop=x
            is_stop=True
    elif e<0:
        stop.remove(x)
        if minstop==x:
            is_stop=False
    elif len(stop)>0:
        if not is_stop:
             minstop=min(stop)
             is_stop=True
        ans[x]=minstop

print('\n'.join(map(str, ans))) import sys sys input=sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline n,q=map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split q event=[] event [] for _ in range(n):
    s,t,x=map(int,input().split())
    event.append((s-x-0.5,1,x))
    event.append((t-x-0.5,-1,x)) _ 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 event.append((s-x-0.5,1,x)) event.append event append (s-x-0.5,1,x) s-x-0.5 s-x s x 0.5 1 x event.append((t-x-0.5,-1,x)) event.append event append (t-x-0.5,-1,x) t-x-0.5 t-x t x 0.5 -1 x for i in range(q):
    event.append((int(input()),0,i)) i range(q) range q event.append((int(input()),0,i)) event.append event append (int(input()),0,i) int(input()) int input() input 0 i event.sort() event.sort event sort is_stop=False is_stop False stop=set() stop set() set minstop=float('inf') minstop float('inf') float 'inf' ans=[-1]*q ans [-1]*q [-1] -1 q for t,e,x in event:
    if e > 0:
        stop.add(x)
        if x<minstop:
            minstop=x
            is_stop=True
    elif e<0:
        stop.remove(x)
        if minstop==x:
            is_stop=False
    elif len(stop)>0:
        if not is_stop:
             minstop=min(stop)
             is_stop=True
        ans[x]=minstop t e x event if e > 0:
        stop.add(x)
        if x<minstop:
            minstop=x
            is_stop=True
    elif e<0:
        stop.remove(x)
        if minstop==x:
            is_stop=False
    elif len(stop)>0:
        if not is_stop:
             minstop=min(stop)
             is_stop=True
        ans[x]=minstop e > 0 e 0 stop.add(x) stop.add stop add x if x<minstop:
            minstop=x
            is_stop=True
     x<minstop x minstop minstop=x minstop x is_stop=True is_stop True elif e<0:
        stop.remove(x)
        if minstop==x:
            is_stop=False
     e<0 e 0 stop.remove(x) stop.remove stop remove x if minstop==x:
            is_stop=False
     minstop==x minstop x is_stop=False is_stop False elif len(stop)>0:
        if not is_stop:
             minstop=min(stop)
             is_stop=True
        ans[x]=minstop len(stop)>0 len(stop) len stop 0 if not is_stop:
             minstop=min(stop)
             is_stop=True
         not is_stop is_stop minstop=min(stop) minstop min(stop) min stop is_stop=True is_stop True ans[x]=minstop ans[x] ans x minstop print('\n'.join(map(str, ans))) print '\n'.join(map(str, ans)) '\n'.join '\n' join map(str, ans) map str ans is_stop=True True is_stop ans=[-1]*q [-1]*q ans minstop=float('inf') float('inf') minstop minstop=x x minstop x=map(int,input().split()) map(int,input().split()) x is_stop=False False is_stop stop=set() set() stop n,q=map(int, input().split()) map(int, input().split()) n is_stop=True True is_stop minstop=min(stop) min(stop) minstop q=map(int, input().split()) map(int, input().split()) q input=sys.stdin.readline sys.stdin.readline input s,t,x=map(int,input().split()) map(int,input().split()) s event=[] [] event t,x=map(int,input().split()) map(int,input().split()) t is_stop=False False is_stop
import sys;input=sys.stdin.readline

n,q=map(int, input().split())
event=[]
for _ in range(n):
    s,t,x=map(int,input().split())
    event.append((s-x-0.5,1,x))
    event.append((t-x-0.5,-1,x))
for i in range(q):
    event.append((int(input()),0,i))

event.sort()
is_stop=False
stop=set()
minstop=float('inf')
ans=[-1]*q
for t,e,x in event:
    if e > 0:
        stop.add(x)
        if x<minstop:
            minstop=x
            is_stop=True
    elif e<0:
        stop.remove(x)
        if minstop==x:
            is_stop=False
    elif len(stop)>0:
        if not is_stop:
             minstop=min(stop)
             is_stop=True
        ans[x]=minstop

print('\n'.join(map(str, ans)))