{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiWayIf #-}


import GHC.TypeLits

import Data.Int
import Data.Proxy
import qualified Data.Map.Lazy as Map
import Data.List
import Data.Bits
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import qualified Data.Vector as V
import qualified Data.Vector.Mutable as VM
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM
import qualified Data.Array.IArray as Array
import Data.Array.MArray
import Data.Array.ST
import Data.Semigroup

import Control.Applicative
import Control.Monad
import Control.Monad.ST
import Control.Monad.Primitive
import Control.Monad.State

import Debug.Trace



getInts :: IO [Int]
getInts = map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine

main :: IO ()
main = do
  [n, q] <- getInts
  [s, t, x] <- transpose <$> replicateM n getInts

  d <- V.fromList . map head <$> (replicateM q getInts)

  seg <- makeDualSegmentTree q :: IO (DualSegmentTree RealWorld (Min Int))

  forM_ (zip3 s t x) $ \(s,t,x) -> do
    let i = lowerBound d (s-x)
    let j = lowerBound d (t-x)
    updateDualSegmentTree i j (Min x) seg

  ans <- forM [0..q-1] $ \i -> do
    Min x <- getDualSegmentTree i seg
    return $ if x == (maxBound :: Int) then -1 else x

  mapM_ print $ ans

  return ()


lowerBound :: Ord a => V.Vector a -> a -> Int
lowerBound vec x = aux (-1) (V.length vec)
  where
    aux lb ub
      | ub-lb > 1 =
        let mid = (lb+ub)`div`2 in
          if vec V.! mid >= x then
            aux lb mid
          else
            aux mid ub
      | otherwise = ub



data DualSegmentTree s m = DualSegmentTree {dualSegmentTree :: VM.MVector s m}


makeDualSegmentTree :: (PrimMonad s, Monoid m) => Int -> s (DualSegmentTree (PrimState s) m)
makeDualSegmentTree n = return . DualSegmentTree =<< VM.replicate (2 * size) mempty
  where
    size = head [m | i <- [0..], let m = 2 ^ i, m >= n]

updateDualSegmentTree :: (PrimMonad s, Monoid m) => Int -> Int -> m -> DualSegmentTree (PrimState s) m -> s ()
updateDualSegmentTree l r val seg = do
  aux 1 0 n
  return ()
  
  where
    s = dualSegmentTree seg
    n = (VM.length s) `div` 2;

    aux i left right
      | right <= l || r <= left = return ()
      | l <= left && right <= r = VM.read s i >>= \x -> VM.write s i (x <> val)
      | otherwise = propag i >> aux (i * 2 + 0) left mid >> aux (i * 2 + 1) mid right
      where mid = (left + right) `div` 2

    propag i = do
      a <- VM.read s i
      when (i < n) $ do
        VM.read s (i * 2 + 0) >>= \b -> VM.write s (i * 2 + 0) (a <> b)
        VM.read s (i * 2 + 1) >>= \b -> VM.write s (i * 2 + 1) (a <> b)
        VM.write s i mempty

getDualSegmentTree :: (PrimMonad s, Monoid m) => Int -> DualSegmentTree (PrimState s) m -> s m
getDualSegmentTree i seg = do
  aux $ i + n
  VM.read s (i + n)
  
  where
    s = dualSegmentTree seg
    n = (VM.length s) `div` 2

    aux x = do
      when (x >= 1) $ do
        aux $ x `div` 2
        propag x

    propag i = do
      a <- VM.read s i
      when (i < n) $ do
        VM.read s (i * 2 + 0) >>= \b -> VM.write s (i * 2 + 0) (a <> b)
        VM.read s (i * 2 + 1) >>= \b -> VM.write s (i * 2 + 1) (a <> b)
        VM.write s i mempty
