import Control.Monad
import qualified Data.Vector as V

main = do
    [a,b,q] <- map read . words <$> getLine
    vss <- (\x->V.fromList $ (-2*10^10):x ++ [2*10^10]) <$> replicateM a readLn 
    vts <- (\x->V.fromList $ (-2*10^10):x ++ [2*10^10]) <$> replicateM b readLn 
    vxs <- (\x->V.fromList $ (-2*10^10):x ++ [2*10^10]) <$> replicateM q readLn 
    sequence_ [print $ a | a <- as]

solve :: V.Vector Int -> V.Vector Int -> Int -> Int
solve vss vts x = minimum [d n|n <-ns]
    where 
        ns = toPair (bIdxSrch vss x (0,V.length vss -1)) (bIdxSrch vts x (0,V.length vts -1))
        d = \(i,j) -> min (abs(x - (vss V.! i)) + abs ((vss V.! i) - (vts V.! j))) (abs (x - (vts V.! j) ) + abs((vss V.! i) - (vts V.! j)))

toPair :: (Int,Int) -> (Int,Int) -> [(Int,Int)]
toPair (a,b) (c,d) = [(a,c),(a,d),(b,c),(b,d)]

bIdxSrch :: V.Vector Int -> Int -> (Int,Int) -> (Int,Int) 
bIdxSrch vs x (l,r)
    | midIdx == l = (l,l+1)
    |  x <= midVal = bIdxSrch vs x (l, midIdx)
    | otherwise = bIdxSrch vs x (midIdx, r)
        where
            midIdx = (r-l) `div` 2 + l
            midVal = vs V.! midIdx

