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