import java.util.Arrays

object Main {

  val amari = 1000000007

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val A, B, Q = sc.nextInt()
    val S = Array.fill(A)(sc.nextLong())
    val T = Array.fill(B)(sc.nextLong())
    val X = Array.fill(Q)(sc.nextLong())

    val S2 = S.sorted
    val T2 = T.sorted

    for {
      x <- X
    } {
      var min: Long = Long.MaxValue

      {
        val s = Arrays.binarySearch(S2, x)

        if (~s != 0) {
          val s1 = S2(~s - 1)
          val t1 = Arrays.binarySearch(T2, s1)
          val t11 = T2(~t1 - 1)
          val t12 = T2(~t1)
          min = Seq(
            Math.abs(s1 - x) + Math.abs(t11 - s1),
            Math.abs(s1 - x) + Math.abs(t12 - s1),
            min
          ).min
        }

        if (~s != A) {
          val s2 = S2(~s)
          val t2 = Arrays.binarySearch(T2, s2)
          val t21 = T2(~t2 - 1)
          val t22 = T2(~t2)
          min = Seq(
            Math.abs(s2 - x) + Math.abs(t21 - s2),
            Math.abs(s2 - x) + Math.abs(t22 - s2),
            min
          ).min
        }
      }

      {
        val t = Arrays.binarySearch(T2, x)

        if (~t != 0) {
          val t1 = T2(~t - 1)
          val s1 = Arrays.binarySearch(S2, t1)
          val s11 = S2(~s1 - 1)
          val s12 = S2(~s1)
          min = Seq(
            Math.abs(t1 - x) + Math.abs(s11 - t1),
            Math.abs(t1 - x) + Math.abs(s12 - t1),
            min
          ).min
        }

        if (~t != B) {
          val t2 = T2(~t)
          val s2 = Arrays.binarySearch(S2, t2)
          val s21 = S2(~s2 - 1)
          val s22 = S2(~s2)
          min = Seq(
            Math.abs(t2 - x) + Math.abs(s21 - t2),
            Math.abs(t2 - x) + Math.abs(s22 - t2),
            min
          ).min
        }
      }

      println(min)
    }
  }
}
