a, b, q = gets.chomp.split(" ").map(&:to_i)
s_ary = []
a.times do
  s_ary.push(gets.to_i)
end
t_ary = []
b.times do
  t_ary.push(gets.to_i)
end
x_ary = []
q.times do
  x_ary.push(gets.to_i)
end

answers_ary = []
route_ab_1 = 0
route_ab_2 = 0
route_ba_1 = 0
route_ba_2 = 0
route_ab_sum = 0
route_ba_sum = 0
nearest_a = 0
nearest_b = 0

x_ary.each_with_index do |x, index|

  nearest_a = s_ary.min_by{|num| (num - x).abs}
  route_ab_1 = (x - nearest_a).abs
  nearest_b = t_ary.min_by{|num| (num - nearest_a).abs}
  route_ab_2 = (nearest_a - nearest_b).abs
  route_ab_sum = route_ab_1 + route_ab_2
  
  nearest_b = t_ary.min_by{|num| (num - x).abs}
  route_ba_1 = (x - nearest_b).abs
  nearest_a = s_ary.min_by{|num| (num - nearest_b).abs}
  route_ba_2 = (nearest_b - nearest_a).abs
  route_ba_sum = route_ba_1 + route_ba_2

  answers_ary.push([route_ab_sum, route_ba_sum].min)
end

puts answers_ary