import Data.List
import Control.Monad
import Data.Array

main :: IO ()
main = do
  (a:b:q:_) <- fmap (map read . words) getLine :: IO [Int]
  ss <- replicateM a $ readLn :: IO [Int]
  ts <- replicateM b $ readLn :: IO [Int]
  qs <- replicateM q $ readLn :: IO [Int]
  mapM_ print $ solve a b ss ts qs

solve a b ss ts qs = map go qs
  where
    sarr = listArray (0, a+1) $ ((minBound `div` 10):sort ss) ++ [maxBound `div` 10]
    tarr = listArray (0, b+1) $ ((minBound `div` 10):sort ts) ++ [maxBound `div` 10]
    go :: Int -> Int
    go q = minimum candidates
      where
        candidates = [
          (max sr tr) - q, 
          sr - tl + sr - q, 
          sr - tl + q - tl, 
          tr - sl + tr - q,
          tr - sl + q - sl, 
          q - (min sl tl)]
        s = lowerBound (\i -> sarr!i > q) (0, a+1)
        t = lowerBound (\i -> tarr!i > q) (0, b+1)
        (sl, sr) = (sarr!(s-1), sarr!s)
        (tl, tr) = (tarr!(t-1), tarr!t)

lowerBound :: (Int -> Bool) -> (Int, Int) -> Int
lowerBound predicate bounds = go bounds
  where
    go (l, h) | l + 1 == h = h
              | predicate m = go (l, m)
              | otherwise = go (m, h)
      where m = (l + h) `div` 2