a, b, q = gets.split.map(&:to_i)
s = [1000000000000]
t = [1000000000000]
x = []
a.times do
  s.push gets.chomp.to_i
end
b.times do
  t.push gets.chomp.to_i
end
q.times do
  x.push gets.chomp.to_i
end

sorted_s = s.sort
sorted_t = t.sort
x.each do |j|
  ind_s_p = sorted_s.bsearch_index { |e| e >= j }
  if ind_s_p > 0
    ind_s_n = ind_s_p - 1
  else
    ind_s_n = 0
  end
  ind_t_p = sorted_t.bsearch_index { |e| e >= j }
  if ind_t_p > 0
    ind_t_n = ind_t_p - 1
  else
    ind_t_n = 0
  end
  candidate = []
  [ind_s_p, ind_s_n].each do |is|
    [ind_t_p, ind_t_n].each do |it|
      ss = sorted_s[is] - j
      tt = sorted_t[it] - j
      if ss * tt >= 0
        candidate.push [ss.abs, tt.abs].max
      else
        candidate.push [ss.abs, tt.abs].min * 2 + [ss.abs, tt.abs].max
      end
    end
  end
  puts candidate.min
end
