a, b, q = gets.chomp.split.map(&:to_i)
s = []
t = []

a.times do |i|
  s[i+1] = gets.to_i
end

b.times do |i|
  t[i+1] = gets.to_i
end

s[0] = -1e18
t[0] = -1e18
s[a+1] = 1e18
t[b+1] = 1e18

s.sort!
t.sort!

q.times do |i|
  x = gets.to_i
  
  b = s.bsearch_index{|z|x<z}
  d = t.bsearch_index{|z|x<z}
  puts [(s[b-1] - x).abs + (s[b-1] - t[d-1]).abs,
   (s[b-1] - x).abs + (s[b-1] - t[d]).abs,
   (s[b] - x).abs + (s[b] - t[d-1]).abs,
   (s[b] - x).abs + (s[b] - t[d]).abs,
   (t[d-1] - x).abs + (s[b-1] - t[d-1]).abs,
   (t[d-1] - x).abs + (s[b] - t[d-1]).abs,
   (t[d] - x).abs + (s[b-1] - t[d]).abs,
   (t[d] - x).abs + (s[b] - t[d]).abs].min
end

