A, B, Q = gets.split.map(&:to_i)
Ss = A.times.map{gets.to_i}
Ts = B.times.map{gets.to_i}
Xs = Q.times.map{gets.to_i}
INF = 1E18.to_i

ss = [-INF] + Ss + [INF]
ts = [-INF] + Ts + [INF]
Xs.each do |x|
  i = ss.bsearch_index{|s| s >= x}
  j = ts.bsearch_index{|t| t >= x}
  puts ss[i - 1, 2].product(ts[j - 1, 2]).flat_map{|s, t| [(s - x).abs + (t - s).abs, (t - x).abs + (s - t).abs]}.min
end