#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9;
const long long mod = 998244353;
signed main() {
  long long n, k, q;
  cin >> n >> k >> q;
  vector<long long> a(n);
  vector<pair<long long, long long> > p(n);
  for (long long i = (0); i < (n); i++) {
    cin >> a[i];
    p[i] = make_pair(a[i], i);
  }
  sort(p.begin(), p.end());
  long long ans = p[q - 1].first - p[0].first;
  set<long long> st;
  a.push_back(0);
  st.insert(n);
  n++;
  for (long long i = (0); i < (n); i++) {
    priority_queue<long long> pq;
    priority_queue<long long> qq;
    for (long long j = (0); j < (n); j++) {
      if (st.find(i) != st.end()) {
        while (pq.size() >= k) {
          long long d = pq.top();
          pq.pop();
          qq.push(d);
        }
        while (!pq.empty()) {
          pq.pop();
        }
      } else {
        pq.push(a[i]);
      }
    }
    if (qq.size() >= q) {
      long long mi = qq.top();
      qq.pop();
      long long ma = qq.top();
      for (long long o = (0); o < (q - 1); o++) {
        ma = qq.top();
        qq.pop();
      }
      ans = max(ans, ma - mi);
    }
    st.insert(p[i].second);
  }
  cout << ans << '\n';
}
