# coding: utf-8
import re
import math
import fractions
import random
from heapq import heappop,heappush
import time
import sys
input = sys.stdin.readline
#import numpy as np

 

 
#main
N,Q=map(int,input().split())
E=[]
for a in range(N):
    s,t,x=map(int,input().split())
    E.append((s-x,1,x))
    E.append((t-x,0,x))

for a in range(Q):
    E.append((int(input()),2,0))
E.sort()
 
S=set()
H=[]
for time_,type_,x in E:
    if type_&1:
        S.add(x)
        heappush(H,x)
    elif not type_:
        S.remove(x)
    else:
        while H and H[0] not in S:
            heappop(H)
        print(H[0] if H else -1) import re re import math math import fractions fractions import random random from heapq import heappop,heappush import time time 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 E=[] E [] for a in range(N):
    s,t,x=map(int,input().split())
    E.append((s-x,1,x))
    E.append((t-x,0,x)) a 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,1,x)) E.append E append (s-x,1,x) s-x s x 1 x E.append((t-x,0,x)) E.append E append (t-x,0,x) t-x t x 0 x for a in range(Q):
    E.append((int(input()),2,0)) a range(Q) range Q E.append((int(input()),2,0)) E.append E append (int(input()),2,0) int(input()) int input() input 2 0 E.sort() E.sort E sort S=set() S set() set H=[] H [] for time_,type_,x in E:
    if type_&1:
        S.add(x)
        heappush(H,x)
    elif not type_:
        S.remove(x)
    else:
        while H and H[0] not in S:
            heappop(H)
        print(H[0] if H else -1) time_ type_ x E if type_&1:
        S.add(x)
        heappush(H,x)
    elif not type_:
        S.remove(x)
    else:
        while H and H[0] not in S:
            heappop(H)
        print(H[0] if H else -1) type_&1 type_ 1 S.add(x) S.add S add x heappush(H,x) heappush H x elif not type_:
        S.remove(x)
     not type_ type_ S.remove(x) S.remove S remove x while H and H[0] not in S:
            heappop(H)
         H and H[0] not in S H H[0] not in S H[0] H 0 S heappop(H) heappop H print(H[0] if H else -1) print H[0] if H else -1 H H[0] H 0 -1 S=set() set() S s,t,x=map(int,input().split()) map(int,input().split()) s H=[] [] H E=[] [] E x=map(int,input().split()) map(int,input().split()) x input = sys.stdin.readline sys.stdin.readline input N,Q=map(int,input().split()) map(int,input().split()) N Q=map(int,input().split()) map(int,input().split()) Q t,x=map(int,input().split()) map(int,input().split()) t
# coding: utf-8
import re
import math
import fractions
import random
from heapq import heappop,heappush
import time
import sys
input = sys.stdin.readline
#import numpy as np

 

 
#main
N,Q=map(int,input().split())
E=[]
for a in range(N):
    s,t,x=map(int,input().split())
    E.append((s-x,1,x))
    E.append((t-x,0,x))

for a in range(Q):
    E.append((int(input()),2,0))
E.sort()
 
S=set()
H=[]
for time_,type_,x in E:
    if type_&1:
        S.add(x)
        heappush(H,x)
    elif not type_:
        S.remove(x)
    else:
        while H and H[0] not in S:
            heappop(H)
        print(H[0] if H else -1)