package main

import (
	"bufio"
	"container/heap"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
)

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)

	n := getNextInt(scanner)
	k := getNextInt(scanner)
	q := getNextInt(scanner)
	aa := make(AA, n)
	for i := 0; i < n; i++ {
		aa[i].a = getNextInt(scanner)
		aa[i].i = i
	}

	sort.Sort(aa)

	hp := &IntHeap{}

	heap.Init(hp)

	temp := make([]int, n)
	min := math.MaxInt32
	for i := 0; i < n-q; i++ {
		for j := 0; j < n; j++ {
			temp[aa[j].i] = aa[j].a
		}
		for j := 0; j < i; j++ {
			heap.Push(hp, aa[j].i)
		}
		heap.Push(hp, n)
		prev := 0
		ans := make([]int, 0)
		for hp.Len() > 0 {
			p := heap.Pop(hp).(int)
			if p-prev < k {
				prev = p + 1
				continue
			}
			sort.Ints(temp[prev:p])
			for j := prev; j < p-k+1; j++ {
				ans = append(ans, temp[j])
			}
			prev = p + 1
		}
		if len(ans) < q {
			continue
		}
		sort.Ints(ans)
		if min > ans[q-1]-ans[0] {
			min = ans[q-1] - ans[0]
		}
	}

	fmt.Fprintln(writer, min)

	writer.Flush()
}

type A struct {
	a, i int
}

type AA []A

func (a AA) Len() int           { return len(a) }
func (a AA) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a AA) Less(i, j int) bool { return a[i].a < a[j].a }

type IntHeap []int

func (h IntHeap) Len() int           { return len(h) }
func (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }
func (h IntHeap) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }
func (h *IntHeap) Push(x interface{}) {
	*h = append(*h, x.(int))
}
func (h *IntHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}
