// Reads multiple ints in a line, separate by a space.
// It works even if the actual number of ints is smaller than n.
// WARNING: This function does not work for -2^31.
// NOTE: This function does not handle error cases.
fun fastReadInts(n: Int): IntArray {
  val xs = IntArray(n)
  val s = readLine()!!
  var currentValue = 0
  var isNegative = false
  var currentIndex = 0
  for (c in s) {
    if (c == ' ') {
      xs[currentIndex] = currentValue * if (isNegative) -1 else 1
      currentValue = 0
      isNegative = false
      currentIndex++
    } else if (c == '-') {
      isNegative = true
    } else {
      currentValue *= 10
      currentValue += c - '0'
    }
  }
  xs[currentIndex] = currentValue * if (isNegative) -1 else 1
  return xs
}

class IntMutableList {
  private val initialCapacity = 10
  private var innerArray = IntArray(initialCapacity)
  var size = 0
    private set

  fun add(x: Int) {
    if (size == innerArray.size) {
      innerArray = innerArray.copyOf(innerArray.size * 2)
    }
    innerArray[size] = x
    size++
  }

  fun toIntArray(): IntArray = innerArray.copyOfRange(0, size)
}

fun main(args: Array<String>) {
  val (n, k, q) = fastReadInts(3)
  val xs = fastReadInts(n)

  var ans = Int.MAX_VALUE

  // Define here for performance.
  val forbidden = BooleanArray(n)
  for (l in xs) {
    forbidden.fill(false)

    for (i in 0 until n) {
      if (xs[i] < l) {
        forbidden[i] = true
      }
    }

    val mutCandidates = IntMutableList()
    var s = 0
    while (s < n) {
      if (forbidden[s]) {
        s++
      } else {
        var t = s
        while (t + 1 < n && !forbidden[t + 1]) {
          t++
        }
        // xs[s]..xs[t] is a valid range.
        val segmentLength = t - s + 1
        if (segmentLength >= k) {
          val segmentValues = mutableListOf<Int>()
          for (i in s..t) {
            segmentValues.add(xs[i])
          }
          segmentValues.sort()
          for (i in 0 until segmentLength - k + 1) {
            mutCandidates.add(segmentValues[i])
          }
        }
        s = t + 1
      }
    }

    if (mutCandidates.size < q) continue

    val candidates = mutCandidates.toIntArray()
    candidates.sort()
    val u = candidates[q - 1]
    ans = Math.min(u - l, ans)
  }
  println(ans)
}
