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] ? s[a-1] : t[b])).abs if a > 0 && b < B
  v << s[a]-t[b-1] + (x-(s[a] < t[b-1] ? s[a]: t[b-1])).abs if a < A && b > 0
  v << (x - (s[a-1] < t[b-1] ? s[a-1] : t[b-1])) if a > 0 && b > 0
  v << ((s[a] > t[b] ? s[a] : t[b]) - 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