import Data.Vector (Vector, (!))
import qualified Data.Vector as V

main = do
  [a,b,q] <- map read . words <$> getLine
  input   <- V.fromList . map read . lines <$> getContents :: IO ( Vector Int )
  let
    (ss, left ) = V.splitAt a input
    (ts, left') = V.splitAt b left
    xs = V.toList left'
  putStr . unlines . map show $ solve ss ts xs

solve ss ts = map (inner ss ts)
  where
  inner ss ts x =
    minimum [ abs (p2 - p1) + abs (p1 - x)
            | (first, second) <- [(fst, snd), (snd, fst)]
            , let ps1 = first nx; ps2 = second nx
            , p1 <- [fst ps1, snd ps1], p2 <- [fst ps2, snd ps2] ]
    where nx = ( nears x ss, nears x ts )

nears x ps
  | x < V.head ps = (-10000000000,V.head ps)
  | x < V.last ps = ( ps!i, ps!(i+1) )
  | otherwise     = (V.last ps, 20000000000)
  where i = borderl (<x) ps

borderl f v = inner 0 (V.length v - 1)
  where
  inner i j
    | i == j    = i
    | otherwise = if f (v!i) then inner i m else inner (m+1) j
    where m = div (i+j) 2