import sys
input = sys.stdin.readline
 
n,q = map(int,input().split())
imos = []
for i in range(n):
    s,t,x = map(int,input().split())
    imos.append((s-x,x))
    imos.append((t-x,-x))
ans = set()
j = 0
for i in range(q):
    d = int(input())
    imos.append((d,1e100))
imos.sort()
m = 1e100
flag = False
for t,stop in imos:
    if stop == 1e100:
        if ans:
            if not flag:
                m = min(ans)
                flag = True
            print(m)
        else:
            print(-1)
    elif stop > 0:
        ans.add(stop)
        if stop < m:
            m = stop
            flag = True
    else:
        ans.remove(-stop)
        if m == -stop:flag = False 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 imos = [] imos [] for i in range(n):
    s,t,x = map(int,input().split())
    imos.append((s-x,x))
    imos.append((t-x,-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 imos.append((s-x,x)) imos.append imos append (s-x,x) s-x s x x imos.append((t-x,-x)) imos.append imos append (t-x,-x) t-x t x -x x ans = set() ans set() set j = 0 j 0 for i in range(q):
    d = int(input())
    imos.append((d,1e100)) i range(q) range q d = int(input()) d int(input()) int input() input imos.append((d,1e100)) imos.append imos append (d,1e100) d 1e100 imos.sort() imos.sort imos sort m = 1e100 m 1e100 flag = False flag False for t,stop in imos:
    if stop == 1e100:
        if ans:
            if not flag:
                m = min(ans)
                flag = True
            print(m)
        else:
            print(-1)
    elif stop > 0:
        ans.add(stop)
        if stop < m:
            m = stop
            flag = True
    else:
        ans.remove(-stop)
        if m == -stop:flag = False t stop imos if stop == 1e100:
        if ans:
            if not flag:
                m = min(ans)
                flag = True
            print(m)
        else:
            print(-1)
    elif stop > 0:
        ans.add(stop)
        if stop < m:
            m = stop
            flag = True
    else:
        ans.remove(-stop)
        if m == -stop:flag = False stop == 1e100 stop 1e100 if ans:
            if not flag:
                m = min(ans)
                flag = True
            print(m)
        else:
            print(-1)
     ans if not flag:
                m = min(ans)
                flag = True
             not flag flag m = min(ans) m min(ans) min ans flag = True flag True print(m) print m print(-1) print -1 elif stop > 0:
        ans.add(stop)
        if stop < m:
            m = stop
            flag = True
     stop > 0 stop 0 ans.add(stop) ans.add ans add stop if stop < m:
            m = stop
            flag = True
     stop < m stop m m = stop m stop flag = True flag True ans.remove(-stop) ans.remove ans remove -stop stop if m == -stop:flag = False m == -stop m -stop stop input = sys.stdin.readline sys.stdin.readline input m = 1e100 1e100 m m = min(ans) min(ans) m flag = False False flag t,x = map(int,input().split()) map(int,input().split()) t n,q = map(int,input().split()) map(int,input().split()) n j = 0 0 j ans = set() set() ans m = stop stop m q = map(int,input().split()) map(int,input().split()) q flag = True True flag imos = [] [] imos s,t,x = map(int,input().split()) map(int,input().split()) s flag = True True flag x = map(int,input().split()) map(int,input().split()) x d = int(input()) int(input()) d
import sys
input = sys.stdin.readline
 
n,q = map(int,input().split())
imos = []
for i in range(n):
    s,t,x = map(int,input().split())
    imos.append((s-x,x))
    imos.append((t-x,-x))
ans = set()
j = 0
for i in range(q):
    d = int(input())
    imos.append((d,1e100))
imos.sort()
m = 1e100
flag = False
for t,stop in imos:
    if stop == 1e100:
        if ans:
            if not flag:
                m = min(ans)
                flag = True
            print(m)
        else:
            print(-1)
    elif stop > 0:
        ans.add(stop)
        if stop < m:
            m = stop
            flag = True
    else:
        ans.remove(-stop)
        if m == -stop:flag = False