n,m,q = gets.split.map(&:to_i)
shr = Array.new(n,0)
tem = Array.new(m,0)
que = Array.new(q,0)
n.times {|i| shr[i] = gets.to_i}
m.times {|i| tem[i] = gets.to_i}
q.times {|i| que[i] = gets.to_i}
shr.push(10**10+1)
tem.push(10**10+1)
for i in 0..q-1
  check = []
  ok = n
  ng = -1
  while (ok - ng).abs > 1
    mid = (ok + ng) / 2
    if shr[mid] < que[i]
      ng = mid
    else
      ok = mid
    end
  end
  check[0] = ok
  ok = m
  ng = -1
  while (ok - ng).abs > 1
    mid = (ok + ng) / 2
    if tem[mid] < que[i]
      ng = mid
    else
      ok = mid
    end
  end
  check[1] = ok
  a = [shr[check[0]],tem[check[1]]].max - que[i]
  b = que[i] - [shr[check[0]-1],tem[check[1]-1]].min
  c = que[i] - shr[check[0]-1]*2 + tem[check[1]]
  d = que[i] - tem[check[1]-1]*2 + shr[check[0]]
  e = shr[check[0]]*2 - que[i] - tem[check[1]-1]
  f = tem[check[1]]*2 - que[i] - shr[check[0]-1]
  if check[0] == 0
    b = 10**12
    c = 10**12
    f = 10**12
  end
  if check[1] == 0
    b = 10**12
    d = 10**12
    e = 10**12
  end
  if check[0] == n
    a = 10**12
    d = 10**12
    e = 10**12
  end
  if check[1] == m
    a = 10**12
    c = 10**12
    f = 10**12
  end
  ans = [a,b,c,d,e,f].min
  puts ans
end
