A, B, Q = gets.chomp.split.map(&:to_i)
Inf = 10**12
as = 0.upto(A-1).map{|i| gets.to_i}
as.unshift(-Inf); as.push(Inf)
bs = 0.upto(B-1).map{|i| gets.to_i}
bs.unshift(-Inf); bs.push(Inf)
xs = 0.upto(Q-1).map{|i| gets.to_i}

ans = Array.new(Q)
xs.each do |x|
  ai = as.bsearch_index{|a| x < a}
  wa = as[ai-1]; ea = as[ai]
  bi = bs.bsearch_index{|b| x < b}
  wb = bs[bi-1]; eb = bs[bi]
  ans_ww = x - [wa, wb].min
  ans_we = [(x - wa) + (eb - wa), (x - wb) + (ea - wb)].min
  ans_ee = [ea, eb].max - x
  ans_ew = [(ea - x) + (ea - wb), (eb - x) + (eb - wa)].min
  ans = [ans_ww, ans_we, ans_ee, ans_ew].min
  puts ans
end