import Data.List
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 ss' = sort ((-inf):inf:ss)
        ts' = sort ((-inf):inf:ts)
        setS = Set.fromList $ zip ss' (tail ss')
        setT = Set.fromList $ zip ts' (tail ts')
    mapM print $ solve (take 75000 xs) setS setT

solve :: [Int] -> Set.Set (Int, Int) -> Set.Set (Int, Int) -> [Int]
solve [] _ _ = []
solve (x:xs) setS setT = 
    case (Set.lookupLE (x, inf) setS, Set.lookupLE (x, inf) setT) of
        (Just (s, s'), Just (t, 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
