import           Control.Applicative (liftA2)
import           Control.Monad       (replicateM)
import           Data.List           (nub)
import           Data.Maybe          (catMaybes)
import           Data.Set            (Set, fromAscList, lookupGE, lookupLE)
import           Data.Vector         (Vector, (!), (!?))
import qualified Data.Vector         as V (fromList, length)

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

-- frame :: [Int] -> [Int]
-- frame is = (- (10 ^ (10 :: Int))) : is ++ [2 * 10 ^ (10 :: Int)]

solveAll :: Set Int -> Set Int -> [Int] -> [Int]
solveAll = (map .) . solve

solveAll' :: Vector Int -> Vector Int -> [Int] -> [Int]
solveAll' = (map .) . solve'

solve :: Set Int -> Set 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'

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 -> Set Int -> [Int] -- return 1 - 2 length list
nearest x xs = nub $ catMaybes [lookupLE x xs, lookupGE x xs]

nearest' :: Int -> Vector Int -> [Int] -- return 1 - 2 length list
nearest' x v = nub $ catMaybes [v !? i, v !? (i + 1)]
  where
    i = lookupLE' x v

lookupLE' :: Ord a => a -> Vector a -> Int
lookupLE' x v = lookupLE'' 0 (length v)
  where
    lookupLE'' :: Int -> Int -> Int
    lookupLE'' lowerB upperB -- range: [lowerB, upperB)
      | upperB - lowerB == 1 = lowerB
      | otherwise =
        let
          current = (lowerB + upperB) `div` 2
        in
          case compare (v ! current) x of
            EQ -> current
            LT -> lookupLE'' current upperB
            GT -> lookupLE'' lowerB current
