#include <bits/stdc++.h>
using namespace std;
bool used[100010];
map<int, vector<int>> mp;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, K, Q;
  cin >> N >> K >> Q;
  int A[100010];
  for (int i = 0; i < N; i++) cin >> A[i];
  for (int i = 0; i < N; i++) mp[A[i]].push_back(i);
  int ans = 2000000000;
  for (int i = 0; i < N; i++) {
    priority_queue<pair<int, int>, vector<pair<int, int>>,
                   greater<pair<int, int>>>
        que;
    for (int i = 0; i < N; i++) que.push({A[i], i});
    vector<int> v;
    while (que.size()) {
      if (!used[que.top().second]) v.push_back(que.top().first);
      que.pop();
    }
    if (v.size() >= Q) {
      sort(v.begin(), v.end());
      ans = min(ans, v[Q - 1] - v[0]);
    } else
      break;
    int last = 0;
    for (int i = 0; i < mp[v[0]].size(); i++) {
      int idx = mp[v[0]][i];
      for (int j = max(last, idx - K + 1); j <= min(N - 1, idx + K - 1); j++)
        used[j] = true;
      last = min(N - 1, idx + K - 1);
    }
  }
  cout << ans << endl;
  return 0;
}
