fun binarySearchFloor(l : List<Long>, x : Long) : Int{
    val i = l.binarySearch(x)
    return if(i >= 0) i else - i - 2
}

fun main(args: Array<String>){
    val INF = 100000000000L
    val (A, B, Q) = readLine()!!.split(" ").map(String::toInt)
    var sl : MutableList<Long> = mutableListOf()
    for (i in 0..(A-1)) {
        sl.add(readLine()!!.toLong())
    }
    var tl : MutableList<Long> = mutableListOf()
    for(i in 0..(B-1)){
        tl.add(readLine()!!.toLong())
    }
    var xl : MutableList<Long> = mutableListOf()
    for(i in 0 .. (Q-1)){
        xl.add(readLine()!!.toLong())
    }
    for(i in 0..(Q-1)){
        val x = xl[i]
        val si = binarySearchFloor(sl, x)
        val ti = binarySearchFloor(tl, x)
        val sWest = if(si >= 0) sl[si] else - INF
        val sEast = if(si < A - 1) sl[si + 1] else INF
        val tWest = if(ti >= 0) tl[ti] else - INF
        val tEast = if(ti < B - 1) tl[ti + 1] else INF
        val ret0 = listOf(Math.abs(x - sWest), Math.abs(x - tWest)).max()!!
        val ret1 = (Math.abs(x - sWest) * 2) + Math.abs(tEast - x)
        val ret2 = (Math.abs(x - tWest) * 2) + Math.abs(sEast - x)
        val ret3 = Math.abs(x - sWest) + (Math.abs(tEast - x) * 2)
        val ret4 = Math.abs(x - tWest) + (Math.abs(sEast - x) * 2)
        val ret5 = listOf(Math.abs(sEast - x), Math.abs(tEast - x)).max()!!
        println((listOf(ret0, ret1, ret2, ret3, ret4, ret5)).min())
    }
}
