import qualified Data.Set as Set

main = do
    [a, b, q] <- map read . words <$> getLine
    ss <- map read <$> sequence (replicate a getLine)
    ts <- map read <$> sequence (replicate b getLine)
    xs <- map read <$> sequence (replicate q getLine)
    let setS = Set.fromList ss
        setT = Set.fromList ts
    mapM print $ solve (take 10000 xs) setS setT

solve :: [Int] -> Set.Set Int -> Set.Set Int -> [Int]
solve [] _ _ = []
solve (x:xs) setS setT = 
    case (Set.lookupLE x setS, Set.lookupGT x setS, Set.lookupLE x setT, Set.lookupGT x setT) of
        (Just s, Just s', Just t, Just t') -> minimum [x - min s t, 2 * (t' - s) - max (x - s) (t' - x), 2 * (s' - t) - max (x - t) (s' - x), max s' t' - x]:solve xs setS setT
        (Just s, Just s', Just t, Nothing) -> minimum [x - min s t, 2 * (s' - t) - max (x - t) (s' - x)]:solve xs setS setT
        (Just s, Just s', Nothing, Just t') -> minimum [2 * (t' - s) - max (x - s) (t' - x), max s' t' - x]:solve xs setS setT
        (Just s, Nothing, Just t, Just t') -> minimum [x - min s t, 2 * (t' - s) - max (x - s) (t' - x)]:solve xs setS setT
        (Nothing, Just s', Just t, Just t') -> minimum [2 * (s' - t) - max (x - t) (s' - x), max s' t' - x]:solve xs setS setT
        (Just s, Nothing, Just t, Nothing) -> minimum [x - min s t]:solve xs setS setT
        (Just s, Nothing, Nothing, Just t') -> minimum [2 * (t' - s) - max (x - s) (t' - x)]:solve xs setS setT
        (Nothing, Just s', Just t, Nothing) -> minimum [2 * (s' - t) - max (x - t) (s' - x)]:solve xs setS setT
        (Nothing, Just s', Nothing, Just t') -> minimum [max s' t' - x]:solve xs setS setT