import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List
import qualified Data.Vector.Unboxed as VU

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    [a,b,q] <- getIntList
    ss <- VU.fromList <$> replicateM a getInt
    ts <- VU.fromList <$> replicateM b getInt
    xs <- replicateM q getInt
    let inf = 20000000000
    ans <- forM xs $ \x -> do
        let sridx = binarySearch x ss
            slidx = sridx - 1
            tridx = binarySearch x ts
            tlidx = tridx - 1
            sr | sridx == a = inf
               | otherwise = ss VU.! sridx
            sl | slidx == -1 = -inf
               | otherwise = ss VU.! slidx
            tr | tridx == b = inf
               | otherwise = ts VU.! tridx
            tl | tlidx == -1 = -inf
               | otherwise = ts VU.! tlidx
        let a1 = (max sr tr) - x
            a2 = (sr - x) * 2 + (x - tl)
            a3 = (x - tl) * 2 + (sr - x)
            a4 = x - (min sl tl) 
            a5 = (x - sl) * 2 + (tr - x)
            a6 = (tr - x) * 2 + (x - sl)
        return $ minimum [a1, a2, a3, a4, a5, a6]
    mapM_ print ans

binarySearch :: Int -> VU.Vector Int -> Int
binarySearch key vec = bs (-1) n
    where n = VU.length vec
          bs :: Int -> Int -> Int
          bs lidx ridx
            | ridx - lidx == 1 = ridx
            | midv >= key = bs lidx midx
            | midv <  key = bs midx ridx
            where midx = lidx + (ridx - lidx) `div` 2
                  midv = vec VU.! midx