
{-# LANGUAGE BangPatterns #-}

import Data.Array (Array, listArray, accumArray, (!))
import Data.List (sortOn, sortBy)
import qualified Data.ByteString.Char8 as B
import Control.Monad (forM_)
import qualified Data.Vector.Unboxed as V
import Data.Char (isSpace)

lowerBound x xs = go xs (-1) (V.length xs) where
  go !xs !l !r
    | l==r-1 = r
    | x==(xs V.! m) = m
    | x<=(xs V.! m) = go xs l m
    | otherwise = go xs m r
    where !m = (l+r) `div` 2
{-# INLINE lowerBound #-}

inf = 10^11

a # b = abs (a-b)
{-# INLINE (#) #-}

near q xs
  | q < V.head xs = (-inf, V.head xs)
  | q > V.last xs = (V.last xs, inf)
  | otherwise = (V.unsafeIndex xs (i-1), V.unsafeIndex xs i)
  where i = lowerBound q xs

solv ss ts qs = map calc (V.toList qs) where
  calc q =
    let !(sl, sr) = near q ss
        !(tl, tr) = near q ts
    in minimum [ min (q#sr + sr#tr) (q#tr + tr#sr)
               , min (q#sr + sr#tl) (q#tl + tl#sr)
               , min (q#sl + sl#tr) (q#tr + tr#sl)
               , min (q#sl + sl#tl) (q#tl + tl#sl)
               ]

main = do
  [a,b,q] <- map read . words <$> getLine :: IO [Int]
  ys <- V.unfoldrN (a+b+q) (B.readInt.B.dropWhile isSpace) <$> B.getContents :: IO (V.Vector Int)
  let ss = V.slice 0 a ys
      ts = V.slice a b ys
      qs = V.slice (a+b) q ys
  putStr . unlines . map show $ solv ss ts qs
