#light "off"

open System

let INF64 = 100000000000L

(*
let readInt () =
    let s = stdin.ReadLine() in
    int s
*)
let readInt64 () =
    let s = stdin.ReadLine() in
    int64 s

let readIntArray () =
    stdin.ReadLine().Split(' ') |>
    Array.map int

(*
let readIntList () =
    stdin.ReadLine().Split(' ') |>
    Array.map int |>
    Array.toList
*)
(*
let readIntList () =
    stdin.ReadToEnd()
        .Split('\n')
        .Select(fun s -> s.Replace("\r", ""))
        .Where(fun s -> s.Length > 0)
        .Select(fun e -> int e)
        .ToArray() |>
    Array.toList
*)

let parseProblem () =
    let ar = readIntArray () in
    let A, B, Q = ar.[0], ar.[1], ar.[2] in
    let S = Array.create (A + 2) 0L in
    let T = Array.create (B + 2) 0L in
    let X = Array.create Q 0L in
    S.[0] <- -INF64;
    for i in 1 .. A do
        S.[i] <- readInt64 ()
    done;
    S.[A + 1] <- INF64;
    T.[0] <- -INF64;
    for i in 1 .. B do
        T.[i] <- readInt64 ()
    done;
    T.[B + 1] <- INF64;
    for i in 0 .. Q - 1 do
        X.[i] <- readInt64 ()
    done;
    A, B, Q, S, T, X

let findLeftmostGe (ar: 'a []) x =
    let rec loop b e =
        let m = (b + e) / 2 in
        if b = e then b
        else if ar.[m] < x then loop (m + 1) e
        else loop b m in
    loop 0 (ar.Length - 1)

let main () =
    let A, B, Q, S, T, X = parseProblem () in
    let search x sl_i tl_i =
        List.min [
            for si in [sl_i - 1; sl_i] do
                for ti in [tl_i - 1; tl_i] do
                    let sv = S.[si] in
                    let tv = T.[ti] in
                    let d0 = abs (tv - sv) + abs (sv - x) in
                    let d1 = abs (tv - sv) + abs (tv - x) in
                    for d in [d0; d1] do
                        yield d
                    done
                done
            done
        ] in
    for x in X do
        let sl_i = findLeftmostGe S x in
        let tl_i = findLeftmostGe T x in
        printfn "%d" <| search x sl_i tl_i
    done

let _ = main ()
