#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1LL << 62;
const long long mod = 1e9 + 7;
int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<long long> A;
  for (int i = 0; i < N; i++) {
    long long a;
    cin >> a;
    A.push_back(a);
  }
  vector<long long> mini;
  for (int i = 0; i + K < N; i++) {
    long long m = LINF;
    for (int j = 0; j < K; j++) {
      m = min(m, A[i + j]);
    }
    mini.push_back(m);
  }
  sort(mini.begin(), mini.end());
  mini.erase(unique(mini.begin(), mini.end()), mini.end());
  long long ans = LINF;
  for (int i = 0; i < mini.size(); i++) {
    vector<long long> t, p;
    for (int j = 0; j < N; j++) {
      if (A[j] >= mini[i]) t.push_back(A[j]);
      if (A[j] < mini[i] || j == N - 1) {
        if (t.size() < K)
          t.clear();
        else {
          sort(t.begin(), t.end());
          for (int k = 0; k < t.size() - K + 1; k++) {
            p.push_back(t[k]);
          }
          t.clear();
        }
      }
    }
    sort(p.begin(), p.end());
    if (p.size() < Q) continue;
    ans = min(ans, p[Q - 1] - p[0]);
  }
  cout << ans << endl;
  return 0;
}
