# include <iostream>
# include <cstdio>
# include <algorithm>
using namespace std;
const int N = 3e5 + 12;
const int inf = 0x7fffffff;
int a[N],n,k,q,ans = inf,b[N],c[N];
int solve(int w)
{
	int l,r;c[0] = 0;
	for(int i = 1;i <= n;i = r + 1)
	{
		l = i;
		while(l <= n && a[l] < w)l++;
		r = l;
		while(r <= n && a[r] >= w)r++;r--;
		b[0] = 0;
		for(int j = l;j <= r;j++)
		b[++b[0]] = a[j];
		if(b[0] < k)continue;
		sort(b + 1,b + b[0] + 1);
		for(int j = 1;j <= b[0] - k + 1;j++)c[++c[0]] = b[j];
	}
	if(c[0] < q)return inf;
	sort(c + 1,c + c[0] + 1);
	return c[q] - w;
}
int main()
{
	scanf("%d %d %d",&n,&k,&q);
	for(int i = 1;i <= n;i++)scanf("%d",&a[i]);
	for(int i = 1;i <= n;i++)ans = min(ans,solve(a[i]));
	printf("%d\n",ans);
}