#include <bits/stdc++.h>
using namespace std;
int n, k, q;
int a[5000], b[5000];
signed main() {
  scanf("%d%d%d", &n, &k, &q);
  set<pair<int, int> > mp;
  for (int i = 0; i < (n); i++)
    scanf("%d", &a[i]), b[i] = a[i], mp.insert({a[i], i});
  sort(b, b + n);
  int ans = b[q - 1] - b[0];
  set<int> se;
  se.insert(-1);
  se.insert(n);
  for (int i = 0; i < (n); i++) {
    int d = mp.begin()->first;
    se.insert(mp.begin()->second);
    mp.erase(mp.begin());
    int cnt = 0;
    int Min = -1, Max = -1;
    for (auto IT = mp.begin(); IT != mp.end(); IT++) {
      if (IT->first <= d) continue;
      if (cnt == q) break;
      auto it = se.lower_bound(IT->second);
      auto it2 = it;
      it2--;
      if (*it2 - *it - 1 < k) continue;
      if (cnt == 0) {
        Min = Max = IT->first;
      }
      Min = min(Min, IT->first);
      Max = max(Max, IT->first);
      cnt++;
    }
    if (cnt == q) ans = min(ans, Max - Min);
  }
  cout << ans << endl;
}
