A,B,Q = gets.chomp.split(" ").map(&:to_i)
s = A.times.map{gets.to_i}
t = B.times.map{gets.to_i}
x = Q.times.map{gets.to_i}
s.sort!
t.sort!
Q.times do |i|
  x1 = (0...s.size).bsearch{|j| s[j] >= x[i]}
  y1 = (0...s.size).bsearch{|j| t[j] >= x[i]}
  x2 = x1 == nil ? A-1 : x1-1
  y2 = y1 == nil ? B-1 : y1-1
  min = 10 ** 12
  if x1 != nil && y2 != -1
    d = [s[x1] - x[i], x[i] - t[y2]].min * 2 + [s[x1] - x[i], x[i] - t[y2]].max
    min = d if d < min
  end
  if y1 != nil && x2 != -1
    d = [t[y1] - x[i], x[i] - s[x2]].min * 2 + [t[y1] - x[i], x[i] - s[x2]].max
    min = d if d < min
  end
  if x1 != nil && y1 != nil
    d = [s[x1],t[y1]].max - x[i]
    min = d if d < min
  end
  if x2 != -1 && y2 != -1
    d = x[i] - [s[x2],t[y2]].min
    min = d if d < min
  end
  puts min
end