$line = <STDIN>;
chomp $line;
($N,$K,$Q) = split(/ /, $line);
$line = <STDIN>;
chomp $line;
@A = split(/ /, $line);

$K2=$K-1;
$Q2=$Q-1;
#$NmK=$N-$K;
@A0 = sort {$a <=> $b} @A;
$minXmY=$A0[$#A0]-$A0[0];

for($i=$N-$Q;$i>=0;$i--){
	$Y=$A0[$i];
	@A3=();
	if($A[0]>=$Y) { @A2=($A[0]); } else { @A2=(); }
	for($j=1;$j<$N;$j++){
		if($A[$j]>=$Y) {
			push @A2, $A[$j];
		} else {
			if($#A2>=$K2) {
				@A2 = sort {$a <=> $b} @A2;
				push @A3,@A2[0..$#A2-$K2];
			}
			@A2=();
			#last if($j>=$NmK); #pruning
		}
	}
	if($#A2>=$K2) {
		@A2 = sort {$a <=> $b} @A2;
		push @A3,@A2[0..$#A2-$K2];
	}
	if($#A3>=$Q2) {
		@A3 = sort {$a <=> $b} @A3;
		$XmY=$A3[$Q2]-$Y;
		$minXmY = $XmY if($minXmY > $XmY);
	}
}
print "$minXmY\n";
