a,b,q=gets.split.map(&:to_i)

s = a.times.map{gets.to_i}.sort
sr= s.reverse
t = b.times.map{gets.to_i}.sort
tr= t.reverse

q.times.each do
  x = gets.to_i

  s1 = s.bsearch{|y| x <= y}
  s2 = sr.bsearch{|y| x >= y}

  t1 = t.bsearch{|y| x <= y}
  t2 = tr.bsearch{|y| x >= y}

  puts ([s1, s2].select{|x|x}.map do |s|
    [t1, t2].select{|x|x}.map do |t|
      [[s-x, t-s], [t-x, s-t]].map{|a| a.map(&:abs).inject(&:+)}.min
    end.min
  end.min)
end
