import kotlin.*


fun main(args: Array<String>) {
    Program().solve()
}

class Program {
    fun solve() {
        val sc = MyScanner()
        val n = sc.nextInt()
        val k = sc.nextInt()
        val q = sc.nextInt()
        val a = sc.intArray()
        val sortedA = a.sorted()
        var ans = sortedA[q - 1] - sortedA[0]
        // a[i]を最小値にできるか
        // a[i] 未満で aを区切る

        for (i in 1 until n) {
            if (sortedA[i - 1] == sortedA[i]) continue
            var c = 0
            val f = Array(n) { sortedA[i] <= a[it] }
            // println(i)
            // println(f.joinToString(" "))
            var flag = false
            var cnt = 0
            for (j in 0 until n) {
                if (f[j]) {
                    if (!flag) {
                        flag = true
                        cnt = 0
                    }
                    cnt++
                } else {
                    if (flag) {
                        c += Math.max(0, cnt - k + 1)
                        flag = false
                    }
                }
            }

            if (flag) {
                c += Math.max(0, cnt - k + 1)
            }

            if (c >= q) {
                ans = Math.min(ans, sortedA[q - 1 + i] - sortedA[i])
            } else {
                break
            }
        }
        println(ans)
    }
}

class MyScanner {
    private var ptr = 0
    private var l = listOf<String>()

    fun next(): String {
        while (l.size <= ptr) {
            l = readLine()!!.split(' ')
            ptr = 0
        }
        return l[ptr++]
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextDouble() = next().toDouble()
    fun nextCharArray() = next().toCharArray()
    fun nextChar() = next()[0]

    fun list(): List<String> {
        ptr = l.size
        return readLine()!!.split(' ')
    }

    fun intList() = list().map { s -> s.toInt() }
    fun longList() = list().map { s -> s.toLong() }
    fun doubleList() = list().map { s -> s.toDouble() }

    fun array() = list().toTypedArray()
    fun intArray() = intList().toIntArray()
    fun longArray() = longList().toLongArray()
    fun doubleArray() = doubleList().toDoubleArray()
}
