import           Control.Applicative (liftA2)
import           Control.Monad       (replicateM)
import           Data.Maybe          (catMaybes)

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

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

solve :: [Int] -> [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

-- sorted
nearest :: Int -> [Int] -> [Int] -- return 0 - 2 length list
nearest x xs =
  let
    (ys, zs) = span (x >=) xs
  in
    catMaybes [safeLast ys, safeHead zs]

safeHead :: [a] -> Maybe a
safeHead []    = Nothing
safeHead (x:_) = Just x

safeLast :: [a] -> Maybe a
safeLast [] = Nothing
safeLast xs = Just $ last xs
