#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll MOD = 1000000007;
using min_que = priority_queue<ll, vector<ll>, greater<ll>>;
int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  ll ans = 1LL << 60;
  for (int i = 0; i < N; i++) {
    ll min_value = A[i];
    vector<min_que> ques;
    ques.push_back(min_que());
    for (int j = 0; j < N; j++) {
      if (min_value <= A[j]) {
        ques.back().push(A[j]);
      } else {
        if (ques.back().size() > 0) {
          ques.push_back(min_que());
        }
      }
    }
    if (ques.back().size() == 0) {
      ques.pop_back();
    }
    priority_queue<P, vector<P>, greater<P>> total_que;
    for (int j = 0; j < ques.size(); j++) {
      total_que.emplace(ques[j].top(), j);
      ques[j].pop();
    }
    ll max_value = min_value;
    for (int t = 0; t < Q; t++) {
      if (total_que.size() == 0) {
        max_value = 1LL << 60;
        break;
      }
      P p = total_que.top();
      total_que.pop();
      max_value = max(max_value, p.first);
      int j = p.second;
      if (ques[j].size() >= K) {
        total_que.emplace(ques[j].top(), j);
        ques[j].pop();
      }
    }
    ans = min(ans, max_value - min_value);
  }
  cout << ans << endl;
  return 0;
}
