def main():
    n,k,q,*a=map(int,open(0).read().split())
    s=sorted
    m=1e18
    for b in a:
        i=[i for i,t in enumerate(a)if t<b]
        l=s(u for t in[s(a[i+1:j])[::-1][k-1:]for i,j in zip([-1]+i,i+[n])]for u in t)
        if len(l)>=q:m=min(m,l[q-1]-b)
    print(m)
main()