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

INF = Float::INFINITY
S.unshift -INF 
S.push INF  
T.unshift -INF 
T.push INF

X.each do |x|
  js = S.bsearch_index{|s| s > x}
  ls = x - S[js - 1]
  rs = S[js] - x
  jt = T.bsearch_index{|t| t > x}
  lt = x - T[jt - 1]
  rt = T[jt] - x
  puts [ls > lt ? ls : lt, 
        rs > rt ? rs : rt,
        rs * 2 + lt, 
        rt * 2 + ls, 
        ls * 2 + rt, 
        lt * 2 + rs].min
end