#include <bits/stdc++.h>
using namespace std;

int N, K, Q;
vector<int> A;
int R = 2000000000;

int main() {
  cin >> N >> K >> Q;
  for(int i = 0; i < N; ++i) {
    int a; cin >> a; A.push_back(a);
  }
  for(int i = 0; i < N; ++i) {
    int m = A[i];
    vector<int> v;
    priority_queue<int, vector<int>, greater<int>> q;
    for(int j = 0; j <= N; ++j) {
      if(j < N && A[j] >= m) v.push_back(A[j]);
      else {
        sort(v.begin(), v.end());
        for(int k = 0; k < (int)v.size() - (K - 1); ++k) {
          q.push(v[k]);
        }
        v.clear();
      }
    }
    if((int)q.size() >= Q) {
      int M;
      for(int k = 0; k < Q; ++k) {
        M = q.top(); q.pop();
      }
      R = min(R, M - m);
    }
  }
  cout << R << endl;
  return 0;
}
