#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2000;
const int INF = 1e9 + 5;
int a[MAXN + 5], N, K, Q;
vector<int> v;
priority_queue<int, vector<int>, greater<int>> pq;
void extract() {
  while (pq.size() >= K) {
    v.push_back(pq.top());
    pq.pop();
  }
  while (!pq.empty()) pq.pop();
}
int test(int x) {
  v.clear();
  while (!pq.empty()) pq.pop();
  for (int i = 0; i <= N; i++) {
    if (i == N || a[i] < x) {
      extract();
      continue;
    }
    pq.push(a[i]);
  }
  sort(v.begin(), v.end());
  if (v.size() < Q) return INF;
  return v[Q - 1] - v[0];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> K >> Q;
  for (int i = 0; i < N; i++) cin >> a[i];
  sort(a, a + N);
  int ans = INF;
  for (int i = 0; N - i >= Q; i++) {
    ans = min(ans, test(a[i]));
  }
  cout << ans << "\n";
}
