io = STDIN
a,b,q=io.gets.split.map(&:to_i)
A=[-10**10]+a.times.map{io.gets.to_i}+[10**11]
B=[-10**10]+b.times.map{io.gets.to_i}+[10**11]
def judge(x,a1,a2,b1,b2)
  [(x-a1)*2+(b2-x),
   (x-a1)+(b2-x)*2,
   [a2,b2].max-x,
   x-[a1,b1].min].min
end
def calc(x)
  ai=A.bsearch_index{|i|i>x}
  bi=B.bsearch_index{|i|i>x}
  judge(x,A[ai-1],A[ai],B[bi-1],B[bi])
end
q.times do
  x=io.gets.to_i
  p calc(x)
end
