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

d = [a]
a.sort()
ans = a[q - 1] - a[0]

while True:
    newd = list()
    li = list()
    for sub in d:
        for c in sub:
            if c != a[0]:
                li.append(c)
            else:
                newd.append(li)
                li = list()
    newd.append(li)

    w = 0
    d = list()
    for li in newd:
        if len(li) < k:
            continue
        else:
            w += len(li) - k + 1
            d.append(li)

    if w >= q:
        a = a[1:]
        ans = min(a[q - 1] - a[0], ans)
    else:
        break
print(ans)