object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val A, B, Q = sc.nextInt
    val INF = Math.pow(10, 12).toLong
    val s = -INF +: Array.fill[Long](A)(sc.nextLong) :+ INF
    val t = -INF +: Array.fill[Long](B)(sc.nextLong) :+ INF
    val x = Array.fill[Long](Q)(sc.nextLong)

    import java.util.Arrays.binarySearch
    import Math.{abs, min}
    for (i <- 0 until Q) {
      var result = Long.MaxValue
      val si = ~binarySearch(s, x(i))
      val ti = ~binarySearch(t, x(i))
      Array(s(si - 1), s(si)).foreach(s1 => {
        Array(t(ti - 1), t(ti)).foreach(t1 => {
          val d1 = abs(s1 - x(i)) + abs(s1 - t1)
          val d2 = abs(t1 - x(i)) + abs(s1 - t1)
          if (min(d1, d2) < result) {
            result = min(d1, d2)
          }
        })
      })
      println(result)
    }

  }
}