A, B, Q = gets.chomp.split(" ").map(&:to_i)
S = Array.new(A).map{gets.to_i}
T = Array.new(B).map{gets.to_i}
R = Array.new(Q).map{gets.to_i}

S.unshift(-10**10); S.push(2*10**10)
T.unshift(-10**10); T.push(2*10**10)
i, j, X = 1, 1, []
while i<=A || j<=B do
  if S[i] < T[j] then
    X << [S[i], [S[i]-T[j-1], T[j]-S[i]].min]
    i += 1
  else
    X << [T[j], [T[j]-S[i-1], S[i]-T[j]].min]
    j += 1
  end
end

R.each{|q|
  idx = X.bsearch_index{|x| x[0] > q}
  if idx.nil? then
    puts q - X[-1][0] + X[-1][1]
  elsif idx == 0
    puts X[0][0] - q + X[0][1]
  else
    puts [q-X[idx-1][0]+X[idx-1][1], X[idx][0]-q+X[idx][1]].min
  end
}
