### BUGGY CODE ###

import queue


class Node(object):
    """docstring for Node"""

    def __init__(self, data=None):
        super(Node, self).__init__()
        self.data = data
        self.left = None
        self.right = None


class BST(object):
    """docstring for BST"""

    def __init__(self):
        super(BST, self).__init__()
        self.root = None

    '''Inorder Traversal'''

    def inorder(self, root):
        res = []
        if root:
            res = self.inorder(root.left)
            res.append(root.data)
            res = res + self.inorder(root.right)
        return res

    '''Finding an element in BST'''

    def find(self, data):
        if self.root is None:
            return 0
        curr = self.root
        while curr:
            if data == curr.data:
                return 1
            elif data < curr.data:
                curr = curr.left
            else:
                curr = curr.right
        return 0

    '''Finding min element in BST'''

    def findMin(self, root):
        if root is None:
            return 0
        root = self.root
        while root.left is not None:
            root = root.left
        return root.data

    '''Finding max element in BST'''

    def findMax(self, root):
        if root == None:
            return 0
        while root.right is not None:
            root = root.right
        return root.data

    '''Inserting an element in BST'''

    def insert(self, root, data):
        if root == None:
            root = Node(data)
        else:
            if data < root.data:
                root.left = self.insert(root.left, data)
            else:
                root.right = self.insert(root.right, data)
        return root

    '''Deleting an element in BST'''

    def delete(self, root, data):
        if root == None:
            return None
        elif data < root.data:
            root.left = self.delete(root.left, data)
        elif data > root.data:
            root.right = self.delete(root.right, data)
        else:
            # Node has two children
            if (root.left is not None) and (root.right is not None):
                temp = self.findMax(root.left)
                root.data = temp
                root.left = self.delete(root.left, root.data)
            else:
                if root.left:  # only left child
                    root = root.left
                elif root.right:  # only right child
                    root = root.right
                else:  # no child
                    root = None
        return root


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()

stop = BST()

ans = {}
for t, e, x in event:
    if e > 0:
        stop.root = stop.insert(stop.root, x)
    elif e < 0:
        stop.root = stop.delete(stop.root, x)
    else:
        if stop.root is not None:
            ans[x] = stop.findMin(stop.root)
        else:
            ans[x] = -1

for i in range(q):
    print(ans[i])


### FIXED CODE ###

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)))