fun main(arr:Array<String>) {
    val n = readLine()!!.toInt()
    val items = readLine()!!.split(" ").map { it.toInt() }.sorted()
    val diff = items[n/2] - items.take(n/2).last()
    println(diff)
}