#include <bits/stdc++.h>
using namespace std;
int N, K, Q;
long long A[2001];
vector<pair<long long, int> > s;
bool used[2001];
int main() {
  cin >> N >> K >> Q;
  for (int i = 0; i < (N); i++) {
    cin >> A[i];
    s.push_back(pair<long long, int>(A[i], i));
    used[i] = false;
  }
  sort(s.begin(), s.end());
  long long ans = 1e18;
  for (int i = 0; i < (N); i++) {
    vector<long long> q;
    vector<long long> v;
    for (int j = 0; j < (N); j++) {
      if (used[j] == true) {
        if (v.size() >= K) {
          sort(v.begin(), v.end());
          reverse(v.begin(), v.end());
          for (int k = K - 1; k < v.size(); k++) {
            q.push_back(v[k]);
          }
          v.clear();
        }
      } else {
        v.push_back(A[j]);
      }
    }
    if (v.size() >= K) {
      sort(v.begin(), v.end());
      reverse(v.begin(), v.end());
      for (int k = K - 1; k < v.size(); k++) {
        q.push_back(v[k]);
      }
      v.clear();
    }
    if (q.size() >= Q) {
      sort(q.begin(), q.end());
      ans = min(ans, q[Q - 1] - q[0]);
    }
    used[s[i].second] = true;
  }
  cout << ans << endl;
  return (0);
}
