def find_nearest_index(xs, i)
  ind = xs.bsearch_index{|x| x >= i }
  return xs.length-1 if ind.nil?
  return ind if ind == 0
  i-xs[ind-1] < xs[ind]-i ? ind-1 : ind
end

A,B,Q = gets.split.map(&:to_i)
ss = A.times.map{ gets.to_i }
ts = B.times.map{ gets.to_i }
xs = Q.times.map{ gets.to_i }

s_neigbor_cost = ss.map{|s| (s-ts[find_nearest_index(ts, s)]).abs }
t_neigbor_cost = ts.map{|t| (t-ss[find_nearest_index(ss, t)]).abs }

puts xs.map{|x|
  s_neigbor_index = find_nearest_index(ss, x)
  s_candidates = [s_neigbor_index]
  s_candidates << s_neigbor_index-1 if s_neigbor_index != 0
  s_candidates << s_neigbor_index+1 if s_neigbor_index != ss.length-1
  s_cost = s_candidates.map{|i|
    (x - ss[i]).abs + s_neigbor_cost[i]
  }.min

  t_neigbor_index = find_nearest_index(ts, x)
  t_candidates = [t_neigbor_index]
  t_candidates << t_neigbor_index-1 if t_neigbor_index != 0
  t_candidates << t_neigbor_index+1 if t_neigbor_index != ts.length-1
  t_cost = t_candidates.map{|i|
    (x - ts[i]).abs + t_neigbor_cost[i]
  }.min

  [s_cost, t_cost].min
}.join("\n")
