A, B, Q = gets.split.map(&:to_i)
S = A.times.map { gets.to_i }.sort
T = B.times.map { gets.to_i }.sort
X = Q.times.map { gets.to_i }

RS = S.reverse
RT = T.reverse

X.each do |x|
  ls = RS.bsearch { |i| -i >= -x }
  rs = S.bsearch { |i| i >= x }
  lt = RT.bsearch { |i| -i >= -x }
  rt = T.bsearch { |i| i >= x }

  ans = Float::INFINITY

  if ls && lt
    ans = [ans, [x - ls, x - lt].max].min
  end

  if rs && rt
    ans = [ans, [rs - x, rt - x].max].min
  end

  if ls && rt
    ans = [ans, 2 * (x - ls) + rt - x].min
    ans = [ans, x - ls + 2 * (rt - x)].min
  end

  if lt && rs
    ans = [ans, 2 * (x - lt) + rs - x].min
    ans = [ans, x - lt + 2 * (rs - x)].min
  end

  puts ans
end
