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

    r = arr.bsearch_index{|xi|xi > x}
    return [arr[r-1], arr[r]]
end


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

    result = nil

    sl = sLR[0]
    sr = sLR[1]
    tl = tLR[0]
    tr = tLR[1]

    if sl && tl
        result = [x - sl, x - tl].max
    end
    if sl && tr
        hoge = (x - sl) * 2 + (tr - x)
        huga = (tr - x) * 2 + (x - sl)
        if result
            result = [hoge, result, huga].min
        else
            result = [hoge,huga].min
        end
    end
    if sr && tl
        hoge = (x - tl) * 2 + (sr - x)
        huga = (sr - x) * 2 + (x - tl)
        if result
            result = [hoge, result, huga].min
        else
            result = [hoge,huga].min
        end
    end
    if sr && tr
        hoge = [sr - x, tr - x].max
        if result
            result = [hoge, result].min
        else
            result = hoge
        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
