#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int N, K, Q, A[2020];
int B[2020];
int minA[2020][2020];
int r[2020];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N >> K >> Q;
  for (int j = 1; j <= N; ++j) cin >> A[j];
  for (int i = 1; i <= N; ++i) {
    minA[i][i] = A[i];
    for (int j = i + 1; j <= N; ++j) {
      minA[i][j] = min(minA[i][j - 1], A[j]);
    }
  }
  for (int i = 1; i <= N; ++i) B[i] = A[i];
  sort(B + 1, B + N + 1);
  int ans = B[Q] - B[1];
  int ng[2020];
  priority_queue<int, vector<int>, greater<int>> pq1, pq2;
  int idx = 1;
  for (int i = 0; i < N; ++i) {
    int threshold = B[idx++];
    while (idx <= N && threshold >= B[idx]) ++idx;
    fill(ng, ng + 2020, 0);
    for (int j = 1; j <= N; ++j) {
      if (A[j] <= threshold) ng[j] = 1;
    }
    while (!pq1.empty()) pq1.pop();
    while (!pq2.empty()) pq2.pop();
    for (int j = 1; j <= N; ++j) {
      if (ng[j]) {
        while (pq1.size() >= K) {
          pq2.push(pq1.top());
          pq1.pop();
        }
        while (!pq1.empty()) pq1.pop();
      } else {
        pq1.push(A[j]);
      }
    }
    if (pq2.size() < Q) break;
    assert(pq2.size() >= 1);
    int min_v = pq2.top();
    while (pq2.size() > 1) pq2.pop();
    int max_v = pq2.top();
    ans = min(ans, max_v - min_v);
  }
  cout << ans << endl;
  return 0;
}
