def slide_min(tl,ql,val):
  res=[0]*(tl-ql+1)
  q=[0]*tl
  s=0
  t=0
  for i in range(0,tl):
    while s<t and val[q[t-1]]>=val[i]:
      t-=1
    q[t]=i
    t+=1
    if (i-ql+1)>=0:
      res[i-ql+1]=q[s]
      if q[s]==(i-ql+1):
        s+=1
  return res

n,k,q=map(int,input().split())
arr=list(map(int,input().split()))
val=[]
for _ in range(q):
  cond=slide_min(n,k,arr)
  tmp=[10**10,0]
  for i in range(n-k+1):
    num=arr[cond[i]]
    if num<tmp[0]:
      tmp[0]=num
      tmp[1]=cond[i]
  val.append(tmp[0])
  n-=1
  arr=arr[:tmp[1]]+arr[tmp[1]+1:]
print(max(val)-min(val))