a, b, q = gets.split.map(&:to_i)
INF = 1e18
s = [-INF] + a.times.map{ gets.to_i } + [INF]
t = [-INF] + b.times.map{ gets.to_i } + [INF]

q.times do
    x = gets.to_i
    s_r = s.bsearch_index{ |ss| ss > x }
    t_r = t.bsearch_index{ |tt| tt > x }
    ans = INF 
    s[s_r-1,2].each do |ss|
        t[t_r-1,2].each do |tt|
            ans = [ans, (x - ss).abs + (ss - tt).abs, (x - tt).abs + (ss - tt).abs].min
        end
    end
    puts ans
end