{-# LANGUAGE RecordWildCards #-}
--module AtCoderBeginnerContest128.E (main) where

import           Control.Monad (replicateM)

main :: IO ()
main = do
  [n, q] <- map read . words <$> getLine
  closures <- replicateM n $ do
    [s, t, x] <- map read . words <$> getLine
    pure $ Closure s t x
  ds <- replicateM q readLn
  mapM_ print $ solve closures ds

data Closure = Closure { start :: Int, end :: Int, point :: Int }

solve :: [Closure] -> [Int] -> [Int]
solve closures = map f
  where
    f d =
      let
        closures' = filter (\Closure {..} -> start <= d + point && d + point < end) closures
      in
        if null closures' then -1 else minimum $ map point closures'

{-
人の式
x = t - D_i

通行止めの式
x = X_i (S_i <= t < T_i)

人と通行止めがぶつかる条件
S_i <= D_i + X_i < T_i
-}
