local function comp(a, b)
  return a < b
end

local function lower_bound(ary, x)
  local num = #ary
  if num == 0 then return 1 end
  if not comp(ary[1], x) then return 1 end
  if comp(ary[num], x) then return num + 1 end
  local min, max = 1, num
  while 1 < max - min do
    local mid = (min + max) // 2
    if comp(ary[mid], x) then
      min = mid
    else
      max = mid
    end
  end
  return max
end

local a, b, q = io.read("*n", "*n", "*n")
local s, t = {}, {}
for i = 1, a do
  s[i] = io.read("*n")
end
for i = 1, b do
  t[i] = io.read("*n")
end
local mab, mmi = math.abs, math.min
for iq = 1, q do
  local x = io.read("*n")
  ap = lower_bound(s, x)
  bp = lower_bound(t, x)
  local al = 1 < ap and s[ap - 1] or false
  local bl = 1 < bp and t[bp - 1] or false
  local ar = ap <= a and s[ap] or false
  local br = bp <= b and t[bp] or false
  local ret = 1000000007 * 100
  if al and bl then
    ret = mmi(ret, mab(x - al) + mab(al - bl), mab(x - bl) + mab(bl - al))
  end
  if al and br then
    ret = mmi(ret, mab(x - al) + mab(al - br), mab(x - br) + mab(br - al))
  end
  if ar and bl then
    ret = mmi(ret, mab(x - ar) + mab(ar - bl), mab(x - bl) + mab(bl - ar))
  end
  if ar and br then
    ret = mmi(ret, mab(x - ar) + mab(ar - br), mab(x - br) + mab(br - ar))
  end
  print(ret)
end
