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.index(s.bsearch{|z|x<z})
  d = t.index(t.bsearch{|z|x<z})
  res = 1e18
  [s[b-1], s[b]].each do |j|
    [t[d-1], t[d]].each do |k|
      d1 = (j-x).abs + (j-k).abs
      d2 = (k-x).abs + (j-k).abs
      res = [res, d1, d2].min
    end
  end
  puts res
end

