local mfl, mmi, mma = math.floor, math.min, math.max
local function lower_bound(ary, x)
  if(x <= ary[1]) then return 1 end
  local num = #ary
  if(ary[num] < x) then return num + 1 end
  local min, max = 1, num
  while(1 < max - min) do
    local mid = mfl((min + max) / 2)
    if(ary[mid] < x) then
      min = mid
    else
      max = mid
    end
  end
  return max
end
local ior = io.input()
local a, b, q = ior:read("*n", "*n", "*n")
local s, t = {}, {}
for i = 1, a do s[i] = ior:read("*n") end
for i = 1, b do t[i] = ior:read("*n") end
for i = 1, q do
  local pos = ior:read("*n")
  local s_right = lower_bound(s, pos)
  local s_left = s_right - 1
  local t_right = lower_bound(t, pos)
  local t_left = t_right - 1
  local len = 20000000000
  local ll, lr, rl, rr = true, true, true, true
  if(s_right == a + 1) then
    rl, rr = false, false
  elseif(s_right == 1) then
    ll, lr = false, false
  end
  if(t_right == b + 1) then
    lr, rr = false, false
  elseif(t_right == 1) then
    ll, rl = false, false
  end
  if(ll) then len = mmi(len, mma(pos - s[s_left], pos - t[t_left])) end
  if(rr) then len = mmi(len, mma(s[s_right] - pos, t[t_right] - pos)) end
  if(lr) then len = mmi(len, -s[s_left] + t[t_right] + mmi(pos - s[s_left], t[t_right] - pos)) end
  if(rl) then len = mmi(len, -t[t_left] + s[s_right] + mmi(pos - t[t_left], s[s_right] - pos)) end
  print(len)
end
