from collections import Counter
n, k, q = map(int, input().split())
a = list(map(int, input().split()))
b = sorted(a)
c = Counter(a)
def avoidable(x):
	if c[b[x]] == 1:
		cnt, tmp = 0, -1
		for i in range(n):
			if a[i] > b[x]:
				tmp += 1
			else:
				cnt += max(0, tmp-k+2)
				tmp = 0
		cnt += max(0, tmp-k+1)
		if cnt < q:
			return False
		else:
			return True
	else:
		ok = False
		for j in range(n):
			if a[j] != b[x]:
				continue
			cnt, tmp = 0, -1
			for i in range(n):
				if a[i] >= b[x] and i != j:
					tmp += 1
				else:
					cnt += max(0, tmp-k+2)
					tmp = 0
			cnt += max(0, tmp-k+1)
			if cnt >= q:
				ok = True
				break
		if ok:
			return True
		else:
			return False

if not avoidable(0):
	#print("hoge")
	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
	ok = min(n-q, ok)
	if k == 1:
		ok = n-q
	while ok >= 0:
		ans = min(ans, b[ok+q-1] - b[ok])
		ok -= 1
	print(ans)