{-# LANGUAGE NumDecimals #-}

import           Control.Applicative (liftA2)
import           Control.Monad       (replicateM)
import           Data.Foldable       (for_)
import           Data.List           (nub)
import           Data.Maybe          (catMaybes)
import           Data.Vector         (Vector, (!), (!?))
import qualified Data.Vector         as V (fromList, length, unsafeIndex)

main :: IO ()
main = do
  [a, b, q] <- map read . words <$> getLine
  ss <- V.fromList . frame <$> replicateM a readLn
  ts <- V.fromList . frame <$> replicateM b readLn
  xs <- replicateM q readLn
  for_ xs $ print . solve ss ts

-- frame 関係なく TLE
frame :: [Int] -> [Int]
frame is = -1e10 : is ++ [2e10]

solve :: Vector Int -> Vector Int -> Int -> Int
solve ss ts x =
  let
    ss' = nearest x ss
    ts' = nearest x ts
  in
    minimum $
    map (\(s, t) -> difference x s + difference s t) $
    liftA2 (,) ss' ts' ++ liftA2 (,) ts' ss'

difference :: Num a => a -> a -> a
difference = (abs .) . subtract

nearest :: Int -> Vector Int -> [Int] -- return 1 - 2 length list
nearest x v = nub [V.unsafeIndex v i, V.unsafeIndex v (i + 1)]
  where
    i = lookupLE x v

lookupLE :: Ord a => a -> Vector a -> Int
lookupLE x v = bisect 0 (V.length v)
  where
    bisect :: Int -> Int -> Int
    bisect lowerB upperB -- section: [lowerB, upperB)
      | upperB - lowerB == 1 = lowerB
      | otherwise =
        let
          middle = (lowerB + upperB) `div` 2
        in
          case compare (V.unsafeIndex v middle) x of
            EQ -> middle
            LT -> bisect middle upperB
            GT -> bisect lowerB middle
