require 'pp'

A,B,Q = readline.chomp.split.map(&:to_i)
S = A.times.each.map {|i| readline.to_i }
T = B.times.each.map {|i| readline.to_i }
X = Q.times.each.map {|i| readline.to_i }

S.sort!
T.sort!

X.each do |x|
  i1 = S.bsearch_index {|s| s >= x } || 0
  s_e = S[i1]
  s_w = S[i1-1]
  i2 = T.bsearch_index {|t| t >= x } || 0
  t_e = T[i2]
  t_w = T[i2-1]

  #pp [s_e,s_w,t_e,t_w]
  a = [
    (x-s_e).abs + (s_e-t_e).abs,
    (x-s_e).abs + (s_e-t_w).abs,
    (x-s_w).abs + (s_w-t_e).abs,
    (x-s_w).abs + (s_w-t_w).abs,
    (x-t_e).abs + (t_e-s_e).abs,
    (x-t_e).abs + (t_e-s_w).abs,
    (x-t_w).abs + (t_w-s_e).abs,
    (x-t_w).abs + (t_w-s_w).abs
  ]
  puts a.min
end

