#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define maxn 300005
#define ll long long
using namespace std;
int a[maxn];
int b[maxn];
int c[maxn]; 
int n, k, q;
int main()
{
	scanf("%d%d%d", &n, &k, &q);
	for(int i = 1; i <= n; i++)
		scanf("%d", &a[i]);
	int ans = 1000000000;
	for(int i = 1; i <= n; i++)
	{	// y >= a[i] mns
		int ncnt = 0;
		for(int j = 1; j <= n; )
		{
			if(a[j] < a[i]) 
			{
				j++;
				continue;
			}
			int npl = j;
			while(npl <= n && a[npl] >= a[i])
				npl++;
			int tms = npl - j - k + 1;
			for(int l = j; l < npl; l++)
				b[l] = a[l];
			sort(b + j, b + npl);
			for(int l = j; l < j + tms; l++)
				c[ncnt++] = b[l];
			j = npl + 1;
		}
		if(ncnt < q) continue;
		sort(c, c + ncnt);
		ans = min(ans, c[q - 1] - a[i]);
	}
	printf("%d\n", ans);
	return 0;
 } 