def binary_search(arr, value)
    
    left = 0
    right = arr.size - 1
    mid = 0

    while left <= right do
        mid = (left + right) / 2

        if arr[mid] == value
            return mid
        elsif arr[mid] < value
            left = mid + 1
        else
            right = mid - 1
        end
    end

    return left
end

def arr_min(arr)
    min = arr[0]
    for i in 1..arr.size-1
        if min > arr[i]
            min = arr[i]
        end
    end
    min
end

A, B, Q = gets.split.map!{|n| n.to_i}
s = Array.new(A)
t = Array.new(B)
x = Array.new(Q)

for i in 1..A
    s[i-1] = gets.to_i
end

for i in 1..B
    t[i-1] = gets.to_i
end

for i in 1..Q
    x[i-1] = gets.to_i
end

s.unshift(-(10 ** 18))
s << 10**18
t.unshift(-(10 ** 18))
t << 10 ** 18
c = Array.new(8)

for i in 1..Q
    v = binary_search(s, x[i-1])
    w = binary_search(t, x[i-1])

    c[0] = (s[v] - x[i-1]).abs + (t[w] - s[v]).abs
    c[1] = (s[v] - x[i-1]).abs + (t[w-1] - s[v]).abs
    c[2] = (s[v-1] - x[i-1]).abs + (t[w] - s[v-1]).abs
    c[3] = (s[v-1] - x[i-1]).abs + (t[w-1] - s[v-1]).abs
    c[4] = (t[w] - x[i-1]).abs + (s[v] - t[w]).abs
    c[5] = (t[w] - x[i-1]).abs + (s[v-1] - t[w]).abs
    c[6] = (t[w-1] - x[i-1]).abs + (s[v] - t[w-1]).abs
    c[7] = (t[w-1] - x[i-1]).abs + (s[v-1] - t[w-1]).abs

    puts arr_min(c)
end