A, B, Q = gets.chomp.split.map(&:to_i)
Inf = 10**12
as = 0.upto(A-1).map{|i| gets.to_i}
as.unshift(-Inf); as.push(Inf)
bs = 0.upto(B-1).map{|i| gets.to_i}
bs.unshift(-Inf); bs.push(Inf)
qs = 0.upto(Q-1).map{|i| [gets.to_i, i]}.
  sort{|q1, q2| q1[0] <=> q2[0]}

qsH = Hash.new{|h,k| h[k] = {}}

ai = bi = 0
qs.each do |x, i|
  if as[ai] <= x
    while ai <= A
      ai += 1
      if x < as[ai]
        break
      end
    end
  end
  if x < as[ai]
    if ai == 0
      qsH[i]["wa"] = nil
    else
      qsH[i]["wa"] = as[ai-1]
    end
    qsH[i]["ea"] = as[ai]
  else      
    qsH[i]["wa"] = as[ai]
    qsH[i]["ea"] = nil
  end
  if bs[bi] <= x
    while bi <= B
      bi += 1
      if x < bs[bi]
        break
      end
    end
  end
  if x < bs[bi]
    if bi == 0
      qsH[i]["wb"] = nil
    else
      qsH[i]["wb"] = bs[bi-1]
    end
    qsH[i]["eb"] = bs[bi]
  else      
    qsH[i]["wb"] = bs[bi]
    qsH[i]["eb"] = nil
  end    
end

#p qsH

ans = Array.new(Q)
qs.each do |x, i|
  wa = qsH[i]["wa"]; ea = qsH[i]["ea"]
  wb = qsH[i]["wb"]; eb = qsH[i]["eb"]
  ans_ww = x - [wa, wb].min
  ans_we = [(x - wa) + (eb - wa), (x - wb) + (ea - wb)].min
  ans_ee = [ea, eb].max - x
  ans_ew = [(ea - x) + (ea - wb), (eb - x) + (eb - wa)].min
  ans[i] = [ans_ww, ans_we, ans_ee, ans_ew].min
end

puts ans