#include <bits/stdc++.h>
using namespace std;
const int N = 2001;
int n,k,q,a[N],ans = 1e9 + 9;
vector<int>temp,b;
void add(){
	sort(temp.rbegin(),temp.rend());
	while(temp.size() >= k)b.push_back(temp.back()),temp.pop_back();
	temp.clear();
}
int main(){
	//freopen("readin.txt","r",stdin);
	scanf("%d%d%d",&n,&k,&q);
	for(int i = 0;i < n;i++)scanf("%d",a + i);
	for(int i = 0;i < n;i++){
		b.clear();temp.clear();
		for(int j = 0;j < n;j++)
			if(a[j] < a[i])add();
			else temp.push_back(a[j]);
		add();
		sort(b.begin(),b.end());
		if(b.size() >= q)ans = min(ans,b[q - 1] - b[0]);
	}
	printf("%d\n",ans);
}