def findLR(x, arr)
    if x < arr[0]
        return [nil, arr[0]]
    elsif x > arr[-1]
        return [arr[-1], nil]
    end

    current = 0
    unit = arr.length / 2
    size = arr.length

    to_right = true
    while true
        n = [current + unit, size -1].max

        if x < arr[n]
            unit = (unit >> 1)
        else
            current = n
        end

        if unit == 0
            return [arr[current], arr[current+1]]
        end
    end
end


def calc(x, s, t)
    sLR = findLR(x, s)
    tLR = findLR(x, t)

    result = nil

    if sLR[0] && tLR[0]
        result = [x - sLR[0], x - tLR[0]].max
    end
    if sLR[0] && tLR[1]
        hoge = (x - sLR[0]) * 2 + (tLR[1] - x)
        huga = (tLR[1] - x) * 2 + (x - sLR[0])
        if result
            result = [hoge, result, huga].min
        else
            result = hoge
        end
    end
    if sLR[1] && tLR[0]
        hoge = (x - tLR[0]) * 2 + (sLR[1] - x)
        huga = (sLR[1] - x) * 2 + (x - tLR[0])
        if result
            result = [hoge, result, huga].min
        else
            result = [hoge,huga].min
        end
    end
    if sLR[1] && tLR[1]
        hoge = [sLR[1] - x, tLR[1] - x].max
        if result
            result = [hoge, result].min
        else
            result = [hoge,huga].min
        end
    end

    return result
end

a,b,q = gets.split.map &:to_i

s = []
a.times do |i|
    s[i] = gets.to_i
end

t = []
b.times do |i|
    t[i] = gets.to_i
end

q.times do |i|
    puts calc(gets.to_i, s, t)
end
