A, B, Q = gets.chomp.split.map(&:to_i)
as = 0.upto(A-1).map{|i| gets.to_i}
bs = 0.upto(B-1).map{|i| gets.to_i}
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 - 2
      ai += 1
      if x < as[ai]
        break
      end
    end
  end
  if x < as[ai]
    if ai == 0
      qsH[i]["westa"] = nil
    else
      qsH[i]["westa"] = as[ai-1]
    end
    qsH[i]["easta"] = as[ai]
  else      
    qsH[i]["westa"] = as[ai]
    qsH[i]["easta"] = nil
  end
  if bs[bi] <= x
    while bi <= B - 2
      bi += 1
      if x < bs[bi]
        break
      end
    end
  end
  if x < bs[bi]
    if bi == 0
      qsH[i]["westb"] = nil
    else
      qsH[i]["westb"] = bs[bi-1]
    end
    qsH[i]["eastb"] = bs[bi]
  else      
    qsH[i]["westb"] = bs[bi]
    qsH[i]["eastb"] = nil
  end    
end

#p qsH

ans = Array.new(Q)
qs.each do |x, i|
  wa = qsH[i]["westa"]; ea = qsH[i]["easta"]
  wb = qsH[i]["westb"]; eb = qsH[i]["eastb"]
  if wa.nil?
    if wb.nil? # [x o] [x o]
      ans_ww = ans_we = ans_ew = 10**11
      ans_ee = [ea, eb].max - x
    else # [x o] [o -]
      if eb.nil? # [x o] [o x]
        ans_ww = ans_ee = 10**11
        ans_we = (x - wb) + (ea - wb)
        ans_ew = (ea - x) + (ea - wb)
      else # [x o] [o o]
        ans_ww = 10**11
        ans_we = (x - wb) + (ea - wb)
        ans_ee = [ea, eb].max - x
        ans_ew = (ea - x) + (ea - wb)
      end
    end
  else # [o -] [- -]
    if wb.nil? # [o -] [x o]
      if ea.nil? # [o x] [x o]
        ans_ww = ans_ee = 10**11
        ans_we = (x - wa) + (eb - wa)
        ans_ew = (eb - x) + (eb - wa)
      else # [o o] [x o]
        ans_ww = 10**11
        ans_we = (x - wa) + (eb - wa)
        ans_ee = [ea, eb].max - x
        ans_ew = (eb - x) + (eb - wa)
      end
    else # [o -] [o -]
      ans_ww = x - [wa, wb].min
      if ea.nil? # [o x] [o -]
        if eb.nil? # [o x] [o x]
          ans_we = ans_ee = ans_ew = 10**11
        else # [o x] [o o]
          ans_ee = 10**11
          ans_we = (x - wa) + (eb - wa)
          ans_ew = (eb - x) + (eb - wa)
        end
      else # [o o] [o -]
        if eb.nil? # [o o] [o x]
          ans_ee = 10**11
          ans_we = (x - wb) + (ea - wb)
          ans_ew = (ea - x) + (ea - wb)
        else # [o o] [o o]
          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
        end
      end
    end
  end
  ans[i] = [ans_ww, ans_we, ans_ee, ans_ew].min
end

puts ans