import qualified Data.Set as Set

inf :: Int
inf = 1000000000000000000

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 ((-inf):inf:ss)
        setT = Set.fromList ((-inf):inf:ts)
    mapM print $ solve (take 50000 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
