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

d = [a]
sa = sorted(a)
ans = sa[q - 1] - sa[0]

while True:
    newd = list()
    li = list()
    for sub in d:
        for c in sub:
            if c != sa[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:
        sa = sa[1:]
        ans = min(sa[q - 1] - sa[0], ans)
    else:
        break
print(ans)