A, B, Q = gets.split.map(&:to_i)

s = []
A.times do
  s << gets.to_i
end
t = []
B.times do
  t << gets.to_i
end
Q.times do
  x = gets.to_i
  sr = s.bsearch_index { |d| d >= x }
  tr = t.bsearch_index { |d| d >= x }

  sl = nil
  if sr.nil
    sl = s.size - 1
  elsif sr > 0
    sl = sr - 1
  end

  tl = nil
  if tr.nil?
    tl = t.size - 1
  elsif tr > 0
    tl = tr - 1
  end

  result = []
  [sl, sr].each do |si|
    [tl, tr].each do |ti|
      next if si.nil? || ti.nil?

      result << (s[si] - x).abs + (t[ti] - s[si]).abs
      result << (t[ti] - x).abs + (s[si] - t[ti]).abs
    end
  end
  puts result.min
end

