-- https://github.com/minoki/my-atcoder-solutions
{-# LANGUAGE BangPatterns #-}
import Data.Char
import Data.List
import Control.Monad
import qualified Data.ByteString.Char8 as BS
import qualified Data.Vector.Unboxed as U
import qualified Data.Vector.Unboxed.Mutable as UM

-- let k = search v f i j
-- => (k < j || f k) && (k == i || not (f (k-1)))
search :: (U.Unbox a) => U.Vector a -> (a -> Bool) -> Int -> Int -> Int
search !v !f !i !j | f (v U.! i) = i
                   | otherwise = loop i j
  where loop !i !j | j == i + 1 = j
                   | f (v U.! k) = loop i k
                   | otherwise = loop k j
          where k = (i + j) `quot` 2

main = do
  [n,q] <- map (read . BS.unpack) . BS.words <$> BS.getLine
  works <- U.replicateM n $ do
    [s,t,x] <- unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
    return (s,t,x)
  ds <- U.replicateM q $ do
    Just (d, _) <- BS.readInt <$> BS.getLine
    return d
  let result = U.create $ do
        vec <- UM.replicate q (10^9+1)
        U.forM_ works $ \(s,t,x) -> do
          let !s' = s - x
              !t' = t - x
              i0 = search ds (\d -> s' <= d) 0 q
              i1 = search ds (\d -> t' <= d) i0 q
          forM_ [i0..(min i1 q)-1] $ \i -> do
            UM.modify vec (\y -> min y x) i
        return vec
  U.forM_ result $ \r ->
    if r == 10^9+1
    then putStrLn "-1"
    else print r
