#include <bits/stdc++.h>
using namespace std;
template <class T>
void chmin(T& a, const T& b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T& a, const T& b) {
  if (a < b) a = b;
}
int N, K, Q;
int A[2010];
vector<int> v;
int main() {
  scanf("%d %d %d", &N, &K, &Q);
  for (int i = 0; i < N; i++) {
    scanf("%d", &A[i]);
    v.push_back(A[i]);
  }
  sort((v).begin(), (v).end());
  v.erase(unique((v).begin(), (v).end()), v.end());
  int ans = 2000000000;
  for (int i = 0; i < v.size(); i++) {
    int cnt = 0;
    int pc = 0;
    priority_queue<int, vector<int>, greater<int> > p, q;
    for (int j = 0; j < N; j++) {
      if (A[j] < v[i]) {
        for (int k = 0; k <= cnt - K; k++) {
          p.push(q.top());
          q.pop();
        }
        pc += cnt - K + 1;
        while (!q.empty()) q.pop();
        cnt = 0;
      } else {
        q.push(A[j]);
        cnt++;
      }
    }
    for (int j = 0; j <= cnt - K; j++) {
      p.push(q.top());
      q.pop();
    }
    pc += cnt - K + 1;
    if (pc < Q) continue;
    for (int j = 0; j < Q - 1; j++) p.pop();
    ans = min(ans, p.top() - v[i]);
  }
  cout << ans << endl;
  return 0;
}
