// 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
}

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 candidates = mutableListOf<Int>()
    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) {
            candidates.add(segmentValues[i])
          }
        }
        s = t + 1
      }
    }

    if (candidates.size < q) continue

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