#include <bits/stdc++.h>
using namespace std;
mt19937_64 mrand(chrono::steady_clock::now().time_since_epoch().count());
int a[2005];
int32_t main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> v;
  for (int i = 1; i <= n; ++i) cin >> a[i], v.push_back(a[i]);
  sort(v.begin(), v.end());
  int ans = 2e9;
  for (int i = 0; i < v.size(); ++i) {
    for (int j = 1; j <= n; ++j)
      if (a[j] < v[i]) a[j] = 0;
    vector<int> tmp;
    int cur = 0, cnt = 0, mn = 1e9;
    for (int j = 1; cnt < q && j <= n; ++j) {
      if (!a[j]) {
        sort(tmp.begin(), tmp.end());
        for (int i = 0; cnt < q && i < (int)tmp.size() - k + 1; ++i)
          mn = min(mn, tmp[i]), cur = max(cur, tmp[i]), ++cnt;
        tmp.clear();
      } else
        tmp.push_back(a[j]);
    }
    if (cnt < q && tmp.size()) {
      sort(tmp.begin(), tmp.end());
      for (int i = 0; cnt < q && i < (int)tmp.size() - k + 1; ++i)
        mn = min(mn, tmp[i]), cur = max(cur, tmp[i]), ++cnt;
    }
    if (cnt == q)
      ans = min(ans, cur - mn);
    else
      break;
  }
  cout << ans << '\n';
}
