#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const int INF = (1 << 30);
int N, K, Q;
vector<int> A;
void input() {
  cin >> N >> K >> Q;
  A.resize(N);
  for (int((i)) = (0); ((i)) < ((N)); ((i))++) cin >> A[i];
}
vector<int> splitter(vector<int> A, int base) {
  vector<int> res(1, -1);
  for (int((i)) = (0); ((i)) < ((N)); ((i))++)
    if (A[i] < base) res.push_back(i);
  res.push_back(N);
  return res;
}
int X_Y(const vector<int> sp, int K, int Q) {
  vector<int> mini;
  for (int((k)) = (0); ((k)) < ((sp.size() - 1)); ((k))++) {
    vector<int> tmp;
    for (int(i) = (sp[k] + 1); (i) < (sp[k + 1]); (i)++) {
      tmp.push_back(A[i]);
    }
    sort(tmp.begin(), tmp.end());
    for (int((i)) = (0); ((i)) < (((int)tmp.size() - K + 1)); ((i))++) {
      mini.push_back(tmp[i]);
    }
  }
  if (mini.size() < Q) return INF;
  sort(mini.begin(), mini.end());
  return mini[Q - 1] - mini[0];
}
void calc() {
  priority_queue<int, vector<int>, greater<int>> pq;
  for (auto num : A) pq.push(num);
  int ans = INF;
  while (true) {
    int base = pq.top();
    pq.pop();
    auto sp = splitter(A, base);
    int tmp = X_Y(sp, K, Q);
    if (tmp == INF) break;
    ans = min(ans, tmp);
  }
  cout << ans << endl;
}
void output() {}
void debug() {
  int N;
  cin >> N;
}
int main() {
  input();
  calc();
  output();
  debug();
  return 0;
}
