# input
a,b,q = gets.chomp.split.map(&:to_i)
a_ary = []
a.times do |i|
    a_ary << gets.chomp.to_i
end
b_ary = []
b.times do |i|
    b_ary << gets.chomp.to_i
end
q_ary = []
q.times do |i|
    q_ary << gets.chomp.to_i
end
a_ary.sort!
b_ary.sort!


def nibuntansaku(ary, kensakuchi)
    if ary[0] >= kensakuchi
        return [0,0]
    end
    if ary[-1] <= kensakuchi
        return [-1,-1]
    end
    ok = 0
    ng = ary.length
    while ((ok-ng).abs > 1)
        mid = (ok+ng)/2
        if ary[mid] < kensakuchi
            ok = mid
        else
            ng = mid
        end
    end
    return [ok,ng]
end
q_ary.each do |i|
    a_tmp = nibuntansaku(a_ary, i)
    b_tmp = nibuntansaku(b_ary, i)

    # p a_tmp
    # p b_tmp
    a_sita = (a_ary[a_tmp[0]] - i).abs
    a_ue = (a_ary[a_tmp[1]] - i).abs
    b_sita = (b_ary[b_tmp[0]] - i).abs
    b_ue = (b_ary[b_tmp[1]] - i).abs
    
    if a_tmp == [0,0]
        a_sita = 10**11
    elsif a_tmp == [-1,-1]
        a_ue = 10**11
    end
    if b_tmp == [0,0]
        b_sita = 10**11
    elsif b_tmp == [-1,-1]
        b_ue = 10**11
    end


    # kokokara4tooritamesu
    ans = [
        a_sita + b_sita - [a_sita, b_sita].min,
        a_ue + b_ue - [a_ue, b_ue].min,
        a_sita + b_ue + [a_sita, b_ue].min,
        a_ue + b_sita + [a_ue, b_sita].min
    ]
    # p [a_sita, a_ue]
    # p [b_sita, b_ue]
    p ans.min
    # puts
end