A, B, Q = gets.split.map(&:to_i)
S = A.times.map{ gets.to_i }+[Float::INFINITY,-Float::INFINITY]
T = B.times.map{ gets.to_i }+[Float::INFINITY,-Float::INFINITY]
Q.times{
	x = gets.to_i
	si = S.bsearch_index{|s| x < s }||A
	ti = T.bsearch_index{|t| x < t }||B
	sl,sr,tl,tr = S[si-1],S[si],T[ti-1],T[ti]
	p [
		[sr,tr].max-x,
		x-[sl,tl].min,
		sr-tl+[sr-x,x-tl].min,
		tr-sl+[tr-x,x-sl].min
	].min
}
