a, b, q = gets.strip.split.map(&:to_i)
s = a.times.map { gets.strip.to_i }
t = b.times.map { gets.strip.to_i }
x = q.times.map { gets.strip.to_i }

x.each do |xx|
  right_s = s.bsearch {|e| e>=xx }
  right_s = right_s-xx if right_s

  left_s = s.reverse.bsearch {|e| e<= xx}
  left_s = xx - left_s if left_s

  right_t = t.bsearch {|e| e>=xx }
  right_t = right_t - xx if right_t

  left_t = t.reverse.bsearch {|e| e<=xx }
  left_t = xx - left_t if left_t

  result = 10**120
  if right_s && right_t
    current = right_s > right_t ? right_s : right_t
    result = current if current < result
  end

  if left_s && left_t
    current = left_s > left_t ? left_s : left_t
    result = current if current < result
  end

  if left_s && right_t
    llr = left_s*2 + right_t
    rrl = left_s + right_t*2
    current = llr < rrl ? llr : rrl
    result = current if current < result
  end

  if left_t && right_s
    llr = left_t *2+ right_s
    rrl = left_t + right_s*2
    current = llr < rrl ? llr : rrl
    result = current if current < result
  end

  p result
end
