import java.util.*

fun main(args: Array<String>) {

    val sc = Scanner(System.`in`)
    val A = sc.nextInt()
    val B = sc.nextInt()
    val Q = sc.nextInt()

    val S = LongArray(A+2)
    val T = LongArray(B+2)
    S[0] = -10000000000L
    S[A+1] =90000000000L
    T[0] = -10000000000L
    T[B+1] =90000000000L
    for (i in 1..A) {
        S[i] = sc.nextLong()
    }
    for (i in 1..B) {
        T[i]  = sc.nextLong()
    }
//    S.forEach {println(it)}
//    println()
//    T.forEach {println(it)}
//    println()


    fun calc(x:Long,s:Pair<Long,Long>,t:Pair<Long,Long>) :Long{
        val (s0,s1) = s
        val (t0,t1) = t
        val res = listOf(x-Math.min(s0,t0), Math.max(s1,t1)-x, 2*Math.min(x-s0, s1-x)+Math.min(x-t0, t1-x),Math.min(x-s0, s1-x)+2*Math.min(x-t0, t1-x))
        return res.min()!!
    }


    fun search(x:Long,X:LongArray) :Pair<Long,Long>{
        var up = X.size-1
        var down = 0
        var x0 = X[down]
        var x1 = X[up]
        while (up-down > 1) {
            val mid = (down+up)/2
            if (x <= X[mid]) up = mid
            else down = mid
            x0 = X[down]
            x1 = X[up]
        }
        return x0 to x1
    }

    for (i in 0 until Q) {
        val x  = sc.nextLong()
        val s = search(x,S)
        val t = search(x,T)

        println(calc(x,s,t))

    }
}
