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

$minXmY=-1;

@A0 = sort {$a <=> $b} @A;
for($i=0;$i<=$N-$Q;$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 {
			$c=$#A2-$K;
			if($c>-2) {
				@A2 = sort {$a <=> $b} @A2;
				push @A3,@A2[0..$c+1];
			}
			@A2=();
			last if($j>=$N-$K); #pruning
		}
	}
	$c=$#A2-$K;
	if($c>-2) {
		@A2 = sort {$a <=> $b} @A2;
		push @A3,@A2[0..$c+1];
	}
	if($#A3+1>=$Q) {
		@A3 = sort {$a <=> $b} @A3;
		$XmY=$A3[$Q-1]-$Y;
		$minXmY = $XmY if($minXmY > $XmY || $minXmY<0);
	}
}

print "$minXmY\n";
