A, B, Q = gets.split(' ').map(&:to_i)
S = A.times.map { gets.to_i }
T = B.times.map { gets.to_i }
X = Q.times.map { gets.to_i }

X.each do |x|
  rsi = S.bsearch_index { |s| s >= x } # right shrine index
  rs = rsi ? S[rsi] : S.last
  ls = rsi ? S[rsi - 1] : rs

  rti = T.bsearch_index { |t| t >= x } # right temple index
  rt = rti ? T[rti] : T.last
  lt = rti ? T[rti - 1] : rt

  min_dist = Float::INFINITY
  [ls, rs].product([lt, rt]).each do |st| # 全8通りの順路の距離を探索
    min_dist = [
      min_dist,
      (x - st[0]).abs + (st[1] - st[0]).abs,
      (x - st[1]).abs + (st[0] - st[1]).abs,
    ].min
  end

  puts min_dist
end