import java.io.BufferedReader
import java.util.*
import kotlin.math.max
import kotlin.math.min

fun main() = abc119d()

@OptIn(ExperimentalStdlibApi::class)
fun abc119d() = SimpleFastIOWithToken_abc119d().exec {
    val infinity = Long.MAX_VALUE / 100
    fun List<Long>.addPosNegInfinity() = buildList {
        add(-infinity);addAll(this@addPosNegInfinity);add(infinity)
    }.toLongArray()

    val (a, b, q) = List(3) { readInt() }
    val shrines = List(a) { readLong() }.addPosNegInfinity()
    val temples = List(b) { readLong() }.addPosNegInfinity()

    fun LongArray.lowerBound(key: Long): Int {
        var ng = -1
        var ok = size

        while (ok - ng > 1) {
            val mid = (ok + ng) / 2
            if (this[mid] >= key) ok = mid else ng = mid
        }
        return ok
    }

    fun minOf(a: Long, b: Long, c: Long, d: Long) = min(min(a, b), min(c, d))

    val answer = StringBuilder()

    repeat(q) {
        val x = readLong()
        val rightShrineIndex = shrines.lowerBound(x)
        val rightTempleIndex = temples.lowerBound(x)

        val leftShrine = shrines[rightShrineIndex - 1]
        val rightShrine = shrines[rightShrineIndex]
        val leftTemple = temples[rightTempleIndex - 1]
        val rightTemple = temples[rightTempleIndex]

        val min = minOf(
            // left shrine, left temple
            x - min(leftShrine, leftTemple),
            // left shrine, right temple
            rightTemple - leftShrine + min(rightTemple - x, x - leftShrine),
            // right shrine, left temple
            rightShrine - leftTemple + min(rightShrine - x, x - leftTemple),
            // right shrine, right temple
            max(rightShrine, rightTemple) - x
        )

        answer.appendln(min)
    }

    print(answer)
}

// region kokokara template dayo (^o^)
@Suppress("unused", "HasPlatformType", "MemberVisibilityCanBePrivate", "ClassName")
private class SimpleFastIOWithToken_abc119d(private val separator: String = System.lineSeparator()) {
    private val br: BufferedReader = System.`in`.bufferedReader()
    private var st: StringTokenizer = StringTokenizer("")
    private val sb: StringBuilder = StringBuilder()
    private fun prepareNext() = run { if (!st.hasMoreTokens()) st = StringTokenizer(br.readLine()) }

    fun readString(): String = run { prepareNext() }.run { st.nextToken() }
    fun readInt(): Int = Integer.valueOf(readString())
    fun readLong(): Long = java.lang.Long.valueOf(readString())

    fun println(): Unit = run { sb.append(separator) }
    fun print(any: Any): Unit = run { sb.append(any) }
    fun println(any: Any): Unit = run { sb.append(any.toString() + separator) }

    fun exec(action: SimpleFastIOWithToken_abc119d.() -> Unit) {
        var t: Throwable? = null
        Thread(null, { action() }, "solve", 128 * 1024 * 1024)
            .apply { setUncaughtExceptionHandler { _, t1 -> t = t1 } }
            .apply { start() }.join()
        t?.let { throw it }
        kotlin.io.print(sb)
    }

    fun readLine(): Nothing = error("readLine is disabled.")
}
// endregion kokomade template dayo (^o^)
