A,B,Q=gets.split.map(&:to_i)
S=A.times.map{gets.to_i}.sort
T=B.times.map{gets.to_i}.sort
Q.times do
  x=gets.to_i
  ar=S.bsearch_index{|i|x<=i}
  ar=A-1 unless ar
  al=[ar-1,0].max
  br=T.bsearch_index{|i|x<=i}
  br=B-1 unless br
  bl=[br-1,0].max
  ans=10**11
  [S[al],S[ar]].each do |a|
    [T[bl],T[br]].each do |b|
      l=[a,b].min
      r=[a,b].max
      d=r-l
      d+=l-x if x<l
      d+=x-r if r<x
      d+=[x-l,r-x].min if l<x && x<r
      ans=[ans,d].min
    end
  end
  p ans
end
