a, b, q = gets.split.map(&:to_i)
s = []
t = []
z = []
a.times do
  s << gets.to_i
end
b.times do
  t << gets.to_i
end
q.times do
  z << gets.to_i
end

before_s = -10**100
before_t = -10**100 - 1

x = (s + t + z).sort
after_s = s.shift
after_t = t.shift

ans = {}

x.each do |i|
  if i == after_s || i == before_s
    before_s = after_s
    after_s = s.shift || 10**100
    next
  end

  if i == after_t || i == before_t
    before_t = after_t
    after_t = t.shift || 10**100 + 1
    next
  end

  if after_t > after_s
    d1 = after_t - i
  else
    d1 = after_s - i
  end

  if before_t < before_s
    d2 = i - before_t
  else
    d2 = i - before_s
  end

  if (i - before_s) < (after_t - i)
    d3 = (i - before_s) * 2 + (after_t - i)
  else
    d3 = (after_t - i) * 2 + (i - before_s)
  end

  if (i - before_t) < (after_s - i)
    d4 = (i - before_t) * 2 + (after_s - i)
  else
    d4 = (after_s - i) * 2 + (i - before_t)
  end

  ans[i] = [d1, d2, d3, d4].min
end


z.each do |i|
  puts ans[i]
end