{-# LANGUAGE BangPatterns          #-}

import Control.Monad
import Control.Applicative
import Data.List as List
import Data.Set as Set

maxPos :: Int
maxPos = 30000000000


distance :: Int -> Int -> Int -> Int
distance !s !t !x
    | s >= x && t >= x = abs ((max t s) - x)
    | s <= x && t <= x = abs ((min t s) - x)
    | otherwise = m1 * 2 + m2
        where
            m1 = min c1 c2
            m2 = max c1 c2
            c1 = abs (s - x)
            c2 = abs (t - x)



solve :: (Set Int) -> (Set Int) -> Int -> Int
solve s t x =
    min c1 $ min c2 $ min c3 c4
    where
        !sr = unwrap $ Set.lookupGE x s
        !sl = unwrap $ Set.lookupLE x s
        !tr = unwrap $ Set.lookupGE x t
        !tl = unwrap $ Set.lookupLE x t
        !c1 = distance sr tr x
        !c2 = distance sr tl x
        !c3 = distance sl tr x
        !c4 = distance sl tl x

readInts :: IO [Int]
readInts = do
    s <- List.map read . words <$> getLine :: IO [Int]
    return s

unwrap :: (Maybe Int) -> Int
unwrap (Just a) = a
unwrap _ = 0

main :: IO()
main = do
    [a, b, q] <- readInts
    s <- replicateM a readLn :: IO [Int]
    t <- replicateM b readLn :: IO [Int]
    qq <- replicateM q readLn :: IO [Int] 
    let !setS = Set.fromList (s ++ [maxPos, -maxPos])
    let !setT = Set.fromList (t ++ [maxPos, -maxPos])
    let !ans = List.map (solve setS setT) qq
    forM_ ans $ print

