import functools
a = [int(x) for x in input().split()]
N = a[0]
K = a[1]
Q = a[2]
b = sorted([int(x) for x in input().split()])
c = [0] * (N-K-Q+2)
for k in range(len(c)):
  c[k] = b[k + Q - 1] - b[k]
d = functools.reduce(lambda x,y:min(x,y),c)
print(d)