#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, k, q;
  cin >> n >> k >> q;
  long long a[n];
  for (int i = (0); i < (n); i++) cin >> a[i];
  long long ans = 1e11;
  for (int i = (0); i < (n); i++) {
    vector<long long> b;
    vector<long long> v;
    for (int j = (0); j < (n); j++) {
      if (a[j] >= a[i])
        v.push_back(a[j]);
      else {
        if (v.size() >= k) {
          sort(v.begin(), v.end());
          int sz = v.size();
          for (int l = (0); l < (min(q, sz - k + 1)); l++) b.push_back(v[l]);
        }
        v.erase(v.begin(), v.end());
      }
    }
    if (v.size() >= k) {
      sort(v.begin(), v.end());
      int sz = v.size();
      for (int l = (0); l < (min(q, sz - k + 1)); l++) b.push_back(v[l]);
    }
    if (b.size() >= q) ans = min(ans, b[q - 1] - a[i]);
  }
  cout << ans << endl;
}
