N,K,Q=map(int,input().split())
A=[int(i) for i in input().split()]
ans=float("inf")
for i in range(N):
  l=A[i]
  A_str=" ".join([(str(a) if a>=l else "x") for a in A])
  S=[list(map(int,a.split())) for a in A_str.split("x")]
  C=[]
  for s in S:
    if len(s)>=K:
      s.sort()
      for i in range(len(s)-K+1):
        C.append(s[i])
  C.sort()
  if len(C)>=Q:
    ans=min(ans,C[Q-1]-C[0])
print(ans)
  
        
      
  
  