#include <bits/stdc++.h>
using namespace std;
const int N = 3e3 + 10;
int n, K, q, a[N];
pair<int, int> b[N];
set<int> s, sraw;
pair<int, int> lower_and_upper(set<int> &s, int t) {
  auto p1 = s.lower_bound(t);
  auto p2 = p1;
  p2++;
  assert(p1 != s.begin());
  assert(p2 != s.end());
  return {*(--p1), *p2};
}
int query_count(int len) { return max(len - K + 1, 0); }
int main() {
  cin >> n >> K >> q;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i) b[i] = {a[i], i};
  sort(b + 1, b + n + 1);
  for (int i = 0; i <= n + 1; ++i) sraw.insert(i);
  int ans = 1e9 + 7;
  for (int i = 1; i <= n; ++i) {
    s = sraw;
    int enough = 0;
    for (int j = i; j <= n; ++j) {
      int idx = b[j].second;
      auto range = lower_and_upper(s, idx);
      s.erase(idx);
      enough -= query_count(idx - range.first - 1);
      enough -= query_count(range.second - idx - 1);
      enough += query_count(range.second - range.first - 1);
      if (enough >= q) {
        int last = j - K + (1 - (enough - q));
        ans = min(ans, b[last].first - b[i].first);
      }
    }
  }
  cout << ans << endl;
}
