import Data.Maybe (isJust, fromJust)
import Data.Array

main :: IO ()
main = do
  [a, b, q] <- map read . words <$> getLine
  ss <- (listArray (1, a) <$>) . sequenceA . replicate a $ read <$> getLine
  ts <- (listArray (1, b) <$>) . sequenceA . replicate b $ read <$> getLine
  xs <- sequenceA . replicate q $ read <$> getLine
  mapM_ (print . f ss ts) xs

f :: Array Int Int -> Array Int Int -> Int -> Integer
f ss ts = g
  where
    g x = min (h slg tlg) (h tlg slg)
      where
        slg = lookupLTGE x ss
        tlg = lookupLTGE x ts
        h slg tlg = minimum . map (snd . foldl step (x, 0) . fromJust) . filter isJust . map sequenceA . sequenceA $ [slg, tlg]

dist x y = toInteger . abs $ y - x

lookupLTGE x ys
  | ys ! l0 >= x
    = [Nothing, Just $ ys ! l0]
  | ys ! r0 < x
    = [Just $ ys ! r0, Nothing]
  | otherwise
    = lr (l0, r0)
  where
    (l0, r0) = bounds ys
    lr (l, r)
      | r <= l + 1
        = [Just $ ys ! l, Just $ ys ! r]
      | ys ! m < x
        = lr (m, r)
      | otherwise
        = lr (l, m)
      where
        m = (l + r) `div` 2

step (y, d) = (,) <$> id <*> (d +) . dist y
