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

c = []
for i in range(n):
    b = [[]]
    minimum = a[i]
    num = 0
    for j in range(n):
        if a[j] < minimum:
            num = num + 1
            b.append([])
        else:
            b[num].append(a[j])
    removable = []
    for j in range(len(b)):
        if len(b[j]) >= k:
            b[j].sort()
            for l in range(len(b[j]) - k + 1):
                removable.append(b[j][l])
    if len(removable) < q:
        continue
    removable.sort()
    maximum = removable[q - 1]
    c.append(maximum - minimum)
print(min(c))