n,k,q = map(int,input().split())
lis = list(map(int,input().split()))
lis.sort()
li = []
coli = []
if k + q > n:
	print(lis[q-1]-lis[0])
	exit()
for h in range(q):
	for i in range(k):
		li.append(lis[i+h])
		coli.append(i)
		
		
print(min(li))