#include <bits/stdc++.h>
using namespace std;
int n, k, q;
vector<int> a;
int ans = 1 << 30;
int main() {
  cin >> n >> k >> q;
  for (long long int i = 0; i < (int)(n); i++) {
    int t;
    cin >> t;
    a.push_back(t);
  }
  for (long long int i = 0; i < (int)(n); i++) {
    int x = a[i];
    vector<int> mi;
    vector<int> tmp;
    for (long long int r = 0; r < (int)(n); r++) {
      if (a[r] < x) {
        sort(tmp.begin(), tmp.end());
        for (long long int j = 0; j < (int)(tmp.size() - k + 1); j++) {
          mi.push_back(tmp[j]);
        }
        tmp.clear();
        continue;
      }
      tmp.push_back(a[r]);
    }
    sort(tmp.begin(), tmp.end());
    for (long long int j = 0; j < (int)(tmp.size() - k + 1); j++) {
      mi.push_back(tmp[j]);
    }
    if (mi.size() < q) continue;
    int y = mi[q - 1];
    ans = min(ans, y - x);
  }
  cout << ans << endl;
}
