#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
using ll = long long;
using ull = unsigned long long;
const int inf = 2e9;
const ll INF = 2e18;
const ll MOD = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n), b(n);
  for (int i = 0; i < (n); i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b.begin(), b.end());
  int ans = inf;
  for (int i = 0; i < (n); i++) {
    int mi = b[i];
    vector<int> v, vv;
    for (int j = 0; j < (n); j++) {
      if (a[j] < mi) {
        if ((vv).size() < k) {
          vv.clear();
        } else {
          sort(vv.begin(), vv.end());
          for (int kk = 0; kk < ((vv).size() - k - 1); kk++) {
            v.push_back(vv[kk]);
          }
          vv.clear();
        }
      } else {
        vv.push_back(a[j]);
      }
    }
    if ((vv).size() < k) {
      vv.clear();
    } else {
      sort(vv.begin(), vv.end());
      for (int kk = 0; kk < ((vv).size() - k + 1); kk++) {
        v.push_back(vv[kk]);
      }
      vv.clear();
    }
    if ((v).size() < q) break;
    sort(v.begin(), v.end());
    ans = min(ans, v[q - 1] - v[0]);
  }
  cout << ans << endl;
  return 0;
}
