const val INF = 1000000000000000L
fun main(args: Array<String>) {
    val (a, b, q) = readLine()!!.split(" ").map { it.toInt() }
    val s = LongArray(a+2) { when(it){
        0 -> -INF
        a+1 -> INF
        else -> readLine()!!.toLong()
    } }
    val t = LongArray(b+2) { when(it){
        0 -> -INF
        b+1 -> INF
        else -> readLine()!!.toLong()
    } }
    val x = (1..q).map { readLine()!!.toLong() }

    val st = s.map {
        if(it==INF||it==-INF) return@map 0L
        val l = -t.binarySearch(it)-2
        val r = -t.binarySearch(it)-1
        Math.min(t[r]-it , it-t[l])
    }
    val ts = t.map {
        if(it==INF||it==-INF) return@map 0L
        val l = -s.binarySearch(it)-2
        val r = -s.binarySearch(it)-1
        Math.min(s[r]-it , it-s[l])
    }

    x.map { xi ->
        val ls = -s.binarySearch(xi)-2
        val rs = -s.binarySearch(xi)-1
        val lt = -t.binarySearch(xi)-2
        val rt = -t.binarySearch(xi)-1
        listOf(xi-s[ls]+st[ls], s[rs]-xi+st[rs], xi-t[lt]+ts[lt], t[rt]-xi+ts[rt] ).min()
    }.joinToString("\n").let { println(it) }
}
