#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(N);
  for (auto& x : A) cin >> x;
  set<int> B;
  for (int x : A) B.insert(x);
  int r = 1 << 30;
  for (int x : B) {
    vector<int> a;
    int c = 0, n = 0;
    for (int i = 0; i < N; ++i) {
      if (A[i] >= x) {
        ++c;
        if (c == K) {
          for (int j = i - c + 1; j <= i; ++j) a.push_back(A[j]);
        } else if (c > K) {
          a.push_back(A[i]);
        }
      } else {
        if (c >= K) n += c - K + 1;
        c = 0;
      }
    }
    if (c >= K) n += c - K + 1;
    if (n < Q) break;
    sort(a.begin(), a.end());
    r = min(r, a[Q - 1] - a[0]);
  }
  cout << r << endl;
}
