package main
 
import (
  "bufio"
  "os"
  "strconv"
  "strings"
  "fmt"
  "sort"
)
 
var reader = bufio.NewReaderSize(os.Stdin, 1000000)
var writer = bufio.NewWriter(os.Stdout)
func NextLine() string {
  var line, buffer []byte
  var isPrefix bool = true
  var err error
  for isPrefix {
    line, isPrefix, err = reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer, line...)
  }
  return string(buffer)
}
func NextIntVec() []int {
  L := strings.Split(NextLine(), " ")
  N := make([]int, len(L))
  for i := range N {
    N[i], _ = strconv.Atoi(L[i])
  }
  return N
}
func Write(s interface{}) {
  fmt.Fprintln(writer, s)
}
func Output() {
  _ = writer.Flush()
}

type Item struct {
  Value int
  Index int
}
type Items []Item
func (A Items) Len() int { return len(A) }
func (A Items) Less(i, j int) bool { return A[i].Value < A[j].Value }
func (A Items) Swap(i, j int) { A[i], A[j] = A[j], A[i] }

func main() {
  NKQ := NextIntVec()
  N, K, Q := NKQ[0], NKQ[1], NKQ[2]
  A := NextIntVec()
  B := make([]Item, N)
  for i := range B {
    B[i] = Item{A[i], i}
  }
  sort.Sort(Items(B))
  D := make([]int, N - Q + 1)
  for i := range D {
    D[i] = B[i + Q - 1].Value - B[i].Value
  }
  C := make([]int, N)
  C[B[0].Index] = 1
  d := D[0]
  for i := 1; i < N - Q + 1; i++ {
    if B[i - 1].Value < B[i].Value {
      k := 0
      s := 0
      for j, c := range C {
        if c == 0 { continue }
        if K < j - s { k += j - s - K }
        s = j + 1
      }
      if K <= N - s { k += N - s - K + 1 }
      if Q <= k && D[i] < d { d = D[i] }
    }
    C[B[i].Index] = 1
  }
  Write(d)
  Output()
}