def b_search(target, sorted)
    l = 0
    r = sorted.size - 1
    while l < r
        center = (l + r) >> 1
        if target < sorted[center] then
            r = center - 1
        else
            l = center + 1
        end
    end
    if target <= sorted[l] then
        return l
    else
        return l + 1
    end
end

input = STDIN.readlines.map{|line|line.strip.split()}
line = input.shift

INF = 10**20
a = line[0].to_i
b = line[1].to_i
q = line[2].to_i

s_list = [-INF]
a.times do |t|
    s_list.push(input.shift[0].to_i)
end
s_list.push(INF)
t_list = [-INF]
b.times do |t|
    t_list.push(input.shift[0].to_i)
end
t_list.push(INF)
q.times do |t|
    x = input.shift[0].to_i
    si = b_search(x, s_list)
    ti = b_search(x, t_list)
    puts([
        (x - s_list[si - 1]).abs + (t_list[ti - 1] - s_list[si - 1]).abs,
        (x - s_list[si - 1]).abs + (t_list[ti] - s_list[si - 1]).abs,
        (x - s_list[si]).abs + (t_list[ti - 1] - s_list[si]).abs,
        (x - s_list[si]).abs + (t_list[ti] - s_list[si]).abs,
        (x - t_list[ti - 1]).abs + (s_list[si - 1] - t_list[ti - 1]).abs,
        (x - t_list[ti - 1]).abs + (s_list[si] - t_list[ti - 1]).abs,
        (x - t_list[ti]).abs + (s_list[si - 1] - t_list[ti]).abs,
        (x - t_list[ti]).abs + (s_list[si] - t_list[ti]).abs,
    ].min)
end
