n, k, q = map(int, input().split())
a = list(map(int, input().split()))
b = sorted(a)

def avoidable(x):
	cnt = 0
	tmp = 0
	for i in range(n):
		if a[i] > b[x]:
			tmp += 1
		else:
			cnt += max(0, tmp-k+1)
			tmp = 0
	cnt += max(0, tmp-k+1)
	if x<q:
		return False
	else:
		return True

if not avoidable(0):
	print(b[q-1] - b[0])
else:
	ok, ng = 0, n
	while ng-ok > 1:
		ind = (ok+ng)//2
		if avoidable(ind):
			ok = ind
		else:
			ng = ind

	ans = 10**10
	while ok >= 0:
		ans = min(ans, b[ok+q-1] - b[ok])
		ok -= 1
	print(ans)