import java.util.*
import java.lang.Math.*

val readString: ()->String = {readLine()!!}
val readInt: ()->Int = {readLine()!!.toInt()}
val readLong: ()->Long = {readLine()!!.toLong()}
val readIntArray: ()->IntArray = {readLine()!!.split(' ').map{it.toInt()}.toIntArray()}
val readLongArray: ()->LongArray = {readLine()!!.split(' ').map{it.toLong()}.toLongArray()}
val errPrintln: (String)->Unit = {msg -> System.err.println(msg)}
val MOD = 1e9.toLong()+7
val INF = Int.MAX_VALUE/2
val LINF = Long.MAX_VALUE/2
data class IntPair(val first: Int, val second: Int)
data class To(val idx: Int, val cost: Long)


fun bsCntLte(A: LongArray, X: Long, includeEqual: Boolean = false): Int {
    return bsIdxLte(A,X, includeEqual) + 1
}
fun bsIdxLte(A: LongArray, X: Long, includeEqual:Boolean = false): Int {
    val N = A.size
    if (N == 0) return -1
    val xLess: (Long)->Boolean = if (includeEqual) {
        { Y:Long -> X < Y }
    } else {
        { Y:Long -> X <= Y }
    }
    if (xLess(A[0])) return -1
    var l = 0; var r = N
    while (l < r - 1) {
        val m = (l + r) / 2
        if (xLess(A[m])) {
            r = m
        } else {
            l = m
        }
    }
    return l
}


fun solve(S: LongArray, T: LongArray, X: LongArray): LongArray {
    val Q = X.size
    val res = LongArray(Q){0L}

    for (q in 0 until Q) {
        val x = X[q]
        val cntS = bsCntLte(S, x)
        val cntT = bsCntLte(T, x)

        val lS = if (cntS>0) S[cntS-1] else null
        val rS = if (S.size - cntS>0) S[cntS] else null
        val lT = if (cntT>0) T[cntT-1] else null
        val rT = if (T.size - cntT>0) T[cntT] else null

        var move = LINF
        if (lS != null && lT != null) {
            val dist = max(abs(lS - x), abs(lT - x))
            move = min(move, dist)
        }
        if (rS != null && rT != null) {
            val dist = max(abs(rS - x), abs(rT - x))
            move = min(move, dist)
        }
        if (lS != null && rT != null) {
            val dist = min(abs(lS - x)*2 + abs(rT - x),  abs(rT - x)*2 + abs(lS - x))
            move = min(move, dist)
        }
        if (rS != null && lT != null) {
            val dist = min(abs(rS - x)*2 + abs(lT - x),  abs(lT - x)*2 + abs(rS - x))
            move = min(move, dist)
        }

        res[q] = move
    }

    return res
}


fun main(args: Array<String>) {
    val (A,B,Q) = readIntArray()
    val S = LongArray(A)
    val T = LongArray(B)
    val X = LongArray(Q)
    for (i in 0 until A) {
        S[i] = readLong()
    }
    for (i in 0 until B) {
        T[i] = readLong()
    }
    for (i in 0 until Q) {
        X[i] = readLong()
    }

    val ans = solve(S,T,X)

    for (a in ans) {
        println(a)
    }
}
