#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, q, A[200001];
  long long ans = 1e18;
  cin >> n >> k >> q;
  for (long long i = 0; i < n; i++) cin >> A[i];
  for (long long i = 0; i < n; i++) {
    vector<long long> B, C;
    long long a = 0;
    for (long long j = 0; j < n; j++) {
      if (A[j] >= A[i]) B.push_back(A[j]);
      if (A[j] < A[i] || j == n - 1) {
        sort(B.begin(), B.end());
        for (long long l = 0; l < max(0, int(B.size() - k + 1)); l++)
          C.push_back(B[l]);
      }
    }
    sort(C.begin(), C.end());
    if (C.size() >= q) {
      for (long long j = 0; j < q; j++) a = max(a, C[j]);
      ans = min(ans, a - A[i]);
    }
  }
  cout << ans;
}
