using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string[] str = Console.ReadLine().Split();
		long N = long.Parse(str[0]);
		long K = long.Parse(str[1]);
		long Q = long.Parse(str[2]);
		long[] A = new long[N];
		string[] str2 = Console.ReadLine().Split();
		for(var i=0;i<N;i++){
			A[i] = long.Parse(str2[i]);
		}
		long mmin = 9999999999;
		long imin = Math.Max(N-(K+Q-1),0);
		long imax = Math.Min(K+Q-1,N);
		if(N<=K+Q){
			for(var i=imin;i<imax;i++){
				mmin = Math.Min(A[i],mmin);
			}
		}
		Array.Sort(A);
		long min = 9999999999;
		for(var i=0;i<N-Q+1;i++){
			long sum = A[i+Q-1] - A[i];
			min = Math.Min(min, sum);
			if(A[i] >= mmin){
				break;
			}
		}
		Console.WriteLine(min);
	}
}