import sys
input=sys.stdin.readline
from collections import deque
from heapq import heappush,heappop
import re

def int_raw():
    return int(input())
 
def ss_raw():
    return input().split()
 
def ints_raw():
    return tuple(map(int, ss_raw()))


def main():
    N ,Q = ints_raw()
    origST = []

    for _  in range(N):
        S,T,X = ints_raw()
        origST.append([S-X,T-X,X])
    Ds = [int(input()) for _ in range(Q)]

    origST.sort()
    stidx = 0
    cur_set = []
    for d in Ds:

        while stidx < len(origST):
            st = origST[stidx]
            if st[0] > d:
                break
            heappush(cur_set,(st[2],st[1]))
            stidx+=1
        while cur_set and cur_set[0][1] <=d:
            heappop(cur_set)
        if cur_set:
            print(cur_set[0][0])
        else:
            print(-1)
main() import sys sys input=sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline from collections import deque from heapq import heappush,heappop import re re def int_raw():
    return int(input())
  int_raw return int(input()) int(input()) int input() input def ss_raw():
    return input().split()
  ss_raw return input().split() input().split() ().split () input split def ints_raw():
    return tuple(map(int, ss_raw())) ints_raw return tuple(map(int, ss_raw())) tuple(map(int, ss_raw())) tuple map(int, ss_raw()) map int ss_raw() ss_raw def main():
    N ,Q = ints_raw()
    origST = []

    for _  in range(N):
        S,T,X = ints_raw()
        origST.append([S-X,T-X,X])
    Ds = [int(input()) for _ in range(Q)]

    origST.sort()
    stidx = 0
    cur_set = []
    for d in Ds:

        while stidx < len(origST):
            st = origST[stidx]
            if st[0] > d:
                break
            heappush(cur_set,(st[2],st[1]))
            stidx+=1
        while cur_set and cur_set[0][1] <=d:
            heappop(cur_set)
        if cur_set:
            print(cur_set[0][0])
        else:
            print(-1) main N ,Q = ints_raw() N ints_raw() ints_raw Q origST = [] origST [] for _  in range(N):
        S,T,X = ints_raw()
        origST.append([S-X,T-X,X])
     _ range(N) range N S,T,X = ints_raw() S ints_raw() ints_raw T X origST.append([S-X,T-X,X]) origST.append origST append [S-X,T-X,X] S-X S X T-X T X X int(input()) for _ in range(Q) for _ in range(Q) _ range(Q) range Q for _ in range(Q) int(input()) int input() input Ds = [int(input()) for _ in range(Q)] Ds [int(input()) for _ in range(Q)] origST.sort() origST.sort origST sort stidx = 0 stidx 0 cur_set = [] cur_set [] for d in Ds:

        while stidx < len(origST):
            st = origST[stidx]
            if st[0] > d:
                break
            heappush(cur_set,(st[2],st[1]))
            stidx+=1
        while cur_set and cur_set[0][1] <=d:
            heappop(cur_set)
        if cur_set:
            print(cur_set[0][0])
        else:
            print(-1) d Ds while stidx < len(origST):
            st = origST[stidx]
            if st[0] > d:
                break
            heappush(cur_set,(st[2],st[1]))
            stidx+=1
         stidx < len(origST) stidx len(origST) len origST st = origST[stidx] st origST[stidx] origST stidx if st[0] > d:
                break
             st[0] > d st[0] st 0 d break heappush(cur_set,(st[2],st[1])) heappush cur_set (st[2],st[1]) st[2] st 2 st[1] st 1 stidx+=1 stidx 1 while cur_set and cur_set[0][1] <=d:
            heappop(cur_set)
         cur_set and cur_set[0][1] <=d cur_set cur_set[0][1] <=d cur_set[0][1] [0] cur_set 0 1 d heappop(cur_set) heappop cur_set if cur_set:
            print(cur_set[0][0])
        else:
            print(-1) cur_set print(cur_set[0][0]) print cur_set[0][0] [0] cur_set 0 0 print(-1) print -1 main() main def int_raw():
    return int(input())
  def int_raw():
    return int(input())
  int_raw def ints_raw():
    return tuple(map(int, ss_raw())) def ints_raw():
    return tuple(map(int, ss_raw())) ints_raw def main():
    N ,Q = ints_raw()
    origST = []

    for _  in range(N):
        S,T,X = ints_raw()
        origST.append([S-X,T-X,X])
    Ds = [int(input()) for _ in range(Q)]

    origST.sort()
    stidx = 0
    cur_set = []
    for d in Ds:

        while stidx < len(origST):
            st = origST[stidx]
            if st[0] > d:
                break
            heappush(cur_set,(st[2],st[1]))
            stidx+=1
        while cur_set and cur_set[0][1] <=d:
            heappop(cur_set)
        if cur_set:
            print(cur_set[0][0])
        else:
            print(-1) def main():
    N ,Q = ints_raw()
    origST = []

    for _  in range(N):
        S,T,X = ints_raw()
        origST.append([S-X,T-X,X])
    Ds = [int(input()) for _ in range(Q)]

    origST.sort()
    stidx = 0
    cur_set = []
    for d in Ds:

        while stidx < len(origST):
            st = origST[stidx]
            if st[0] > d:
                break
            heappush(cur_set,(st[2],st[1]))
            stidx+=1
        while cur_set and cur_set[0][1] <=d:
            heappop(cur_set)
        if cur_set:
            print(cur_set[0][0])
        else:
            print(-1) main def ss_raw():
    return input().split()
  def ss_raw():
    return input().split()
  ss_raw input=sys.stdin.readline sys.stdin.readline input
import sys
input=sys.stdin.readline
from collections import deque
from heapq import heappush,heappop
import re

def int_raw():
    return int(input())
 
def ss_raw():
    return input().split()
 
def ints_raw():
    return tuple(map(int, ss_raw()))


def main():
    N ,Q = ints_raw()
    origST = []

    for _  in range(N):
        S,T,X = ints_raw()
        origST.append([S-X,T-X,X])
    Ds = [int(input()) for _ in range(Q)]

    origST.sort()
    stidx = 0
    cur_set = []
    for d in Ds:

        while stidx < len(origST):
            st = origST[stidx]
            if st[0] > d:
                break
            heappush(cur_set,(st[2],st[1]))
            stidx+=1
        while cur_set and cur_set[0][1] <=d:
            heappop(cur_set)
        if cur_set:
            print(cur_set[0][0])
        else:
            print(-1)
main()
