A, B, Q = gets.split.map(&:to_i)
ss = [-10**18] + A.times.map{gets.to_i} + [10**18]
ts = [-10**18] + B.times.map{gets.to_i} + [10**18]
sr = ss.reverse
tr = ts.reverse
Q.times do
    x = gets.to_i
    ls = ss.bsearch{|y| y >= x} - x
    lt = ts.bsearch{|y| y >= x} - x
    rs = x - sr.bsearch{|y| y <= x}
    rt = x - tr.bsearch{|y| y <= x}
    ans = [[ls, lt].max, [rs, rt].max, ls*2+rt, ls+rt*2, lt*2+rs, lt+rs*2].min
    puts ans
end