A, B, Q = gets.split.map(&:to_i)

s = A.times.map do
  gets.to_i
end

t = B.times.map do
  gets.to_i
end

S = [-10**11 - 1] + s + [10**11 + 1]
T = [-10**11 - 1] + t + [10**11 + 1]

X = Q.times.map do
  gets.to_i
end

X.each do |x|
  distance = []
  # 最初に神社
  i = S.bsearch_index {|s| s >= x}
  # pattern1, 2
  j = T.bsearch_index {|t| t >= S[i - 1]}
  distance << (x - S[i - 1]).abs + (S[i-1] - T[j-1]).abs
  distance << (x - S[i - 1]).abs + (S[i-1] - T[j]).abs
  # p "shrine: #{S[i - 1]} template: #{T[j - 1]}"
  # p "shrine: #{S[i - 1]} template: #{T[j]}"
  # pattern3, 4
  j = T.bsearch_index {|t| t >= S[i]}
  distance << (x - S[i]).abs + (S[i] - T[j-1]).abs
  distance << (x - S[i]).abs + (S[i] - T[j]).abs
  # p "shrine: #{S[i]} template: #{T[j - 1]}"
  # p "shrine: #{S[i]} template: #{T[j]}"

  # 最初に寺
  i = T.bsearch_index {|t| t >= x}
  # pattern 5, 6
  j = S.bsearch_index {|t| t >= T[i - 1]}
  distance << (x - T[i - 1]).abs + (T[i - 1] - S[j - 1]).abs
  distance << (x - T[i - 1]).abs + (T[i - 1] - S[j]).abs
  # p "shrine: #{S[j - 1]} template: #{T[i - 1]}"
  # p "shrine: #{S[j]} template: #{T[i - 1]}"
  # pattern 7, 8
  j = S.bsearch_index {|t| t >= T[i]}
  distance << (x - T[i]).abs + (T[i] - S[j - 1]).abs
  distance << (x - T[i]).abs + (T[i] - S[j]).abs

  # p distance
  puts distance.min
end
