# debug
debugFlag = ( ARGV[0] != nil )
p "==== DEBUG MODE ====" if debugFlag

# util functions
def find_posmin(arr)
  m = arr.max
  arr.each do |e_i|
    m = e_i if e_i > 0 and m > e_i
  end
  return m
end

# input
a, b, q = $stdin.gets.chomp.split(" ").map(&:to_i)
shrs = []
a.times do
  shrs << $stdin.gets.chomp.to_i
end

tmps = []
b.times do
  tmps << $stdin.gets.chomp.to_i
end

xs = []
q.times do
  xs << $stdin.gets.chomp.to_i
end

# input check
if debugFlag
  p "--- INPUT (begin) ---"
  p shrs
  p tmps
  p xs
  p "--- INPUT (end) ---"
  print "\n"
end

# body
if debugFlag
end

xs.each do |x_i|
  sw = nil
  se = nil
  tw = nil
  te = nil
  # shrs.size.times do |j|
  #   if x_i <= shrs[j]
  #     sw = shrs[j - 1]  # can be nil
  #     se = shrs[j]
  #     break
  #   end
  # end
  j = shrs.bsearch_index { |s| x_i <= s }
  if j
    sw = shrs[j - 1]  # can be nil
    se = shrs[j]
  end
  if se == nil
    sw = shrs[-1]
  elsif se == shrs[0]
    sw = nil
  end

  # tmps.size.times do |j|
  #   if x_i <= tmps[j]
  #     tw = tmps[j - 1]  # can be nil
  #     te = tmps[j]
  #     break
  #   end
  # end
  j = tmps.bsearch_index { |t| x_i <= t }
  if j
     tw = tmps[j - 1]  # can be nil
     te = tmps[j]
  end
  if te == nil
    tw = tmps[-1]
  elsif te == tmps[0]
    tw = nil
  end

  if debugFlag
    p x_i
    print "sw:"  
    p sw
    print "se:"    
    p se
    print "tw:"      
    p tw
    print "te:"        
    p te
  end

  cur = x_i
  costs = []
  [te, tw].each do |t|
    tmp_cost = 0
    next if t == nil
    tmp_cost += (cur - t).abs
    [se, sw].each do |s|
      next if s == nil
      costs << (t - s).abs + tmp_cost
    end
  end
  if te != nil and se != nil and te >= se
    costs << (cur - te).abs
  end
  if tw != nil and sw != nil and tw <= sw
    costs << (cur - tw).abs
  end

  cur = x_i
  [se, sw].each do |s|
    tmp_cost = 0
    next if s == nil
    tmp_cost += (cur - s).abs
    [te, tw].each do |t|
      next if t == nil
      costs << (s - t).abs + tmp_cost
    end
  end
  if te != nil and se != nil and te >= se
    costs << (cur - se).abs
  end
  if sw != nil and tw != nil and sw <= tw
    costs << (cur - sw).abs
  end
  #p costs
  #print "---"
  p costs.min
end
