#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
struct edge {
  long long to, cost;
};
long long a[2005];
long long use[2005];
vector<pair<long long, long long> > v;
vector<long long> V;
void disp() {
  for (long long i = 0; i < V.size(); i++) {
    if (i) cout << ' ';
    cout << V[i];
  }
  cout << endl;
}
signed main() {
  long long n, k, q;
  cin >> n >> k >> q;
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < n; i++)
    v.push_back(pair<long long, long long>(a[i], i));
  sort(v.begin(), v.end());
  long long ans = 1145141919;
  use[n] = 1;
  for (long long i = 0; i < n; i++) {
    long long mn = v[i].first;
    for (long long j = 0; j < n; j++) {
      if (a[j] < mn) use[j]++;
    }
    long long s = 0, t = 0;
    vector<long long> VA;
    for (long long j = 0; j < n + 1; j++) {
      if (!use[j])
        t = j;
      else {
        if (t - s + 1 >= k) {
          for (long long l = s; l <= t; l++) {
            VA.push_back(a[l]);
          }
        }
        s = j + 1;
        t = j + 1;
        sort(VA.begin(), VA.end());
        for (long long l = 0; l < min((long long)VA.size(), q); l++)
          V.push_back(VA[l]);
        VA.clear();
      }
    }
    sort(V.begin(), V.end());
    if (V.size() < q) break;
    ans = min(ans, V[q - 1] - V[0]);
    V.clear();
  }
  cout << ans << endl;
}
