a, b, q = gets.chomp.split.map(&:to_i)
# sarr = Array.new(a + 4); sarr[0] = -114514; sarr[1] = -114514; sarr[-1] = 114514; sarr[-2] = 114514
# tarr = Array.new(b + 4); tarr[0] = -114514; tarr[1] = -114514; tarr[-1] = 114514; tarr[-2] = 114514

# 2.upto(a + 1) do |i|
# 	sarr[i] = gets.chomp.to_i
# end
# 2.upto(b + 1) do |i|
# 	tarr[i] = gets.chomp.to_i
# end
sarr = Array.new(a)
tarr = Array.new(b)
a.times do |i|
	sarr[i] = gets.chomp.to_i
end
b.times do |i|
	tarr[i] = gets.chomp.to_i
end

sarr = sarr.sort
tarr = tarr.sort

starr = Array.new(a + b + 8);
starr[0] = [-114514810810, true]; starr[1] = [-114514810810, true]; starr[2] = [-114514810810, false]; starr[3] = [-114514810810, false]
starr[-4] = [114514818100, true]; starr[-3] = [114514810810, true]; starr[-2] = [114514810810, false]; starr[-1] = [114514810810, false]


si = 0
ti = 0
while si < sarr.length || ti < tarr.length
	if ti > tarr.length || (si < sarr.length && sarr[si] < tarr[ti])
		starr[si + ti + 4] = [sarr[si], true]
		si += 1
	else
		starr[si + ti + 4] = [tarr[ti], false]
		ti += 1
	end
end


def binarys(x, arr)
	l = 0
	r = arr.length - 1
	prev = -114514
	while l < r
		mid = (l + r) / 2
		return mid if arr[mid][0] == x || prev == mid
		if arr[mid][0] < x 
			l = mid
		else
			r = mid
		end
		prev = mid
	end
	return prev
end

#p starr
q.times do
	x = gets.chomp.to_i
	ind = binarys(x, starr)

	#現在地
	if starr[ind][0] == x
		l = 114514
		(ind-1).downto(0) do |i|
			if starr[i][1] != starr[ind][1]
				l = starr[i][0]
				break
			end
		end
		r = 114514
		(ind+1).upto(starr.length-1) do |i|
			if starr[i][1] != starr[ind][1]
				r = starr[i][0]
				break
			end
		end
		puts ([l, r].min - x).abs
		exit
	end

	
	# 左側の神社と寺を2つ列挙
	ls = nil
	lt = nil
	ind.downto(0) do |i|
		if starr[i][1]
			ls = (starr[i][0] - x).abs if ls == nil
		else
			lt = (starr[i][0] - x).abs if lt == nil
		end
		break if ls != nil && lt != nil
	end

	#右側
	rs = nil
	rt = nil
	(ind+1).upto(starr.length-1) do |i|
		if starr[i][1]
			rs = (starr[i][0] - x).abs if rs == nil
		else
			rt = (starr[i][0] - x).abs if rt == nil
		end
		break if rs != nil && rt != nil
	end


	#左左
	ll = [ls, lt].max
	rr = [rs, rt].max

	lr = ls < lt ? ls * 2 + rt : lt * 2 + rs
	rl = rs < rt ? rs * 2 + lt : rt * 2 + ls

	# lr = ls[0] < lt[0] ? ls[0] * 2 + rt[0] : lt[0] * 2 + rs[0]
	# rl = rs[0] < rt[0] ? rs[0] * 2 + lt[0] : rt[0] * 2 + ls[0]

	
	# puts "ind:#{ind}"
	# puts "lt:#{lt} ls:#{ls} rt:#{rt} rs:#{rs}"
	# puts "ll:#{ll} rr:#{rr} lr:#{lr} rl:#{rl}"
	puts [ll, rr, lr, rl].min
	#puts
end
