#include <bits/stdc++.h>
using namespace std;
int n, k, q, A[2050];
bool use[2050];
vector<pair<int, int>> v;
int main() {
  cin >> n >> k >> q;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    v.push_back(pair<int, int>(A[i], i));
  }
  sort(v.begin(), v.end());
  multiset<int> chosen;
  int ans = INT_MAX;
  use[n] = true;
  for (auto i : v) {
    int val = i.first, pos = i.second;
    priority_queue<int, vector<int>, greater<int>> pq;
    for (int j = 0; j <= n; j++) {
      if (use[j]) {
        while (pq.size() >= k) {
          chosen.insert(pq.top());
          pq.pop();
        }
        while (pq.size() > 0) pq.pop();
      } else {
        pq.push(A[j]);
      }
    }
    use[pos] = true;
    if (chosen.size() < q) continue;
    while (chosen.size() > q) chosen.erase(--chosen.end());
    ans = min(ans, *prev(chosen.end()) - *chosen.begin());
    chosen.clear();
  }
  cout << ans;
}
