io = STDIN
a,b,q=io.gets.split.map(&:to_i)
A=a.times.map{io.gets.to_i}
B=b.times.map{io.gets.to_i}
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 judge2(x,from,to)
  [(x-from)*2+to-x,x-from+(to-x)*2].min
end
def calc(x)
  ai=A.bsearch_index{|i|i>x}
  bi=B.bsearch_index{|i|i>x}
  if ai==0 && bi == 0
    [A[0],B[0]].max-x
  elsif ai==nil && bi==nil
    x-[A[-1],B[-1]].min
  elsif ai==0 || bi==0
    if ai==0
      if bi==nil
        judge2(x,B[-1],A[0])
      else
        judge(x,-Float::INFINITY,A[ai],B[bi-1],B[bi])
      end
    else
      if ai==nil
        judge2(x,A[-1],B[0])
      else
        judge(x,A[ai-1],A[ai],-Float::INFINITY,B[bi])
      end
    end
  elsif ai==nil || bi==nil
    if ai==nil
      judge(x,A[-1],Float::INFINITY,B[bi-1],B[bi])
    else
      judge(x,A[ai-1],A[ai],B[-1],Float::INFINITY)
    end
  else
    judge(x,A[ai-1],A[ai],B[bi-1],B[bi])
  end
end
q.times do
  x=io.gets.to_i
  p calc(x)
end
