A, B, Q = gets.split.map(&:to_i)
INF = 10**12

s=[-INF]
A.times do |i|
  s[i+1] = gets.to_i
end
s[A+1] = INF

t=[-INF]
B.times do |i|
  t[i+1] = gets.to_i
end
t[B+1] = INF

x=[]
Q.times do |i|
  x[i] = gets.to_i
end

Q.times do |i|
  j = s.bsearch_index{|y| x[i] < y}
  k = t.bsearch_index{|y| x[i] < y}

  ans =[
    (x[i]-s[j-1]).abs + [(s[j-1]-t[k-1]).abs, (s[j-1]-t[k]).abs].min,
    (x[i]-s[j]).abs + [(s[j]-t[k-1]).abs, (s[j]-t[k]).abs].min,
    (x[i]-t[k-1]).abs + [(t[k-1]-s[j-1]).abs, (t[k-1]-s[j]).abs].min,
    (x[i]-t[k]).abs + [(t[k]-s[j-1]).abs,(t[k]-s[j]).abs].min
  ].min

  puts ans
end
