def solve(x,s,t)
  a = (0..A-1).bsearch{|i| s[i] >= x}
  b = (0..B-1).bsearch{|i| t[i] >= x}
  a = A if !a
  b = B if !b
  v = []
  v << t[b]-s[a-1] + [x-s[a-1],t[b]-x].min if a > 0 && b < B
  v << s[a]-t[b-1] + [s[a]-x,x-t[b-1]].min if a < A && b > 0
  v << x - [s[a-1],t[b-1]].min if a > 0 && b > 0
  v << [s[a],t[b]].max - x if a < A && b < B
  return v.min
end

A,B,Q = gets.split.map(&:to_i)
s,t=[],[]
A.times do
  s << gets.to_i
end

B.times do
  t << gets.to_i
end
s.sort!
t.sort!
Q.times do
  x = gets.to_i
  p solve(x,s,t)
end