#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, k, Q;
  cin >> n >> k >> Q;
  long long a[2000], b[2000];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b, b + n);
  long long ans = b[Q - 1] - b[0];
  for (long long m = 0; m < n; m++) {
    priority_queue<long long> q;
    for (long long i = 0; i < n; i++) {
      if (a[i] < a[m]) {
        continue;
      }
      priority_queue<long long> q2;
      while (a[i] >= a[m]) {
        q2.push(-a[i]);
        i++;
        if (i == n) break;
      }
      while (q2.size() > k) {
        q.push(q2.top());
        q2.pop();
      }
    }
    if (q.size() < Q) continue;
    long long y = -q.top();
    for (long long i = 0; i < Q - 1; i++) {
      q.pop();
    }
    long long x = -q.top();
    ans = min(ans, x - y);
  }
  cout << ans << endl;
  return 0;
}
