fun lower_bound(v: LongArray, num: Long): Int {
    var l = 0
    var r = v.size
    while(r - l > 1){
        val mid = (l + r) / 2
        if(v[mid] < num)l = mid
        else r = mid
    }
    if(v[l] < num)l++
    return l
}

fun main(args: Array<String>) {
    val (a, b, q) = readLine()!!.split(" ").map{it.toInt()}
    val s = LongArray(a)
    val t = LongArray(b)
    val x = LongArray(q)
    for(i in 0 until a)s[i] = readLine()!!.toLong()
    for(i in 0 until b)t[i] = readLine()!!.toLong()
    for(i in 0 until q)x[i] = readLine()!!.toLong()

    for(i in 0 until q){
        var ans = 1000000000000000L
        val A = lower_bound(s, x[i])
        val B = lower_bound(t, x[i])
        if(A < s.size && B < t.size) {
            ans = Math.min(ans, Math.max(s[A], t[B]) - x[i])
        //    println("   ${Math.max(s[A], t[B]) - x[i]}")
        }
        if(A < s.size && B != 0){
            ans = Math.min(ans, s[A] - t[B-1] + Math.min(s[A] - x[i], x[i] - t[B-1]))
        //    println("   ${s[A] - t[B-1] + Math.min(s[A] - x[i], x[i] - t[B-1])}")
        }
        if(B < t.size && A != 0){
            ans = Math.min(ans, t[B] - s[A-1] + Math.min(t[B] - x[i], x[i] - s[A-1]))
        //    println("   ${t[B] - s[A-1] + Math.min(t[B] - x[i], x[i] - s[A-1])}")
        }
        if(A != 0 && B != 0){
            ans = Math.min(ans, x[i] - Math.min(s[A-1], t[B-1]))
        //    println("   ${x[i] - Math.min(s[A-1], t[B-1])}")
        }

        println(ans)
    }
}