#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, k, q;
  cin >> n >> k >> q;
  long long a[n];
  for (long long i = (0); i < (n); i++) {
    cin >> a[i];
  }
  bool use[n + 1];
  memset(use, 0, sizeof(use));
  use[n] = true;
  vector<pair<long long, long long> > pos;
  for (long long i = (0); i < (n); i++) {
    pos.push_back(pair<long long, long long>(a[i], i));
  }
  sort(pos.begin(), pos.end());
  long long ans = INF;
  for (long long i = (0); i <= (n); i++) {
    priority_queue<long long> pq;
    long long l = 0;
    for (long long r = (0); r <= (n); r++) {
      if (use[r]) {
        if (r - l > k) {
          priority_queue<long long> tmp;
          for (long long j = (l); j < (r); j++) {
            tmp.push(-a[j]);
          }
          for (long long j = (1); j <= (r - l - k + 1); j++) {
            pq.push(tmp.top());
            tmp.pop();
          }
        }
        l = r + 1;
      }
    }
    if (pq.size() >= q) {
      long long buf = pq.top();
      for (long long i = (1); i <= (q - 1); i++) {
        pq.pop();
      }
      buf -= pq.top();
      ans = min(buf, ans);
    } else {
      break;
    }
    use[pos[i].second] = true;
  }
  cout << (ans) << endl;
  return 0;
}
