#include <bits/stdc++.h>
#pragma warning(disable : 4996)
const long long MOD = 1000000007;
using namespace std;
void solve() {
  int n, K, Q;
  scanf("%d%d%d", &n, &K, &Q);
  vector<int> a(n);
  vector<pair<int, int> > z;
  int i, j;
  map<int, int> cnt;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    z.push_back(make_pair(a[i], i));
    cnt[a[i]]++;
  }
  sort(z.begin(), z.end());
  long long ans = 9223300000000000000;
  auto it = cnt.begin();
  for (; it != cnt.end(); ++it) {
    int tmp0 = it->first;
    vector<int> save;
    int cnt = 0;
    for (i = 0; i < n; i++) {
      int val = z[i].first;
      int id = z[i].second;
      if (val < tmp0) {
        save.push_back(id);
      } else {
        break;
      }
    }
    save.push_back(-1);
    save.push_back(n);
    sort(save.begin(), save.end());
    int siz = (int)save.size();
    long long ans0 = -2140000000;
    vector<int> num(siz);
    int cnt0 = 0;
    for (; i < n; i++) {
      int val = z[i].first;
      int id = z[i].second;
      int k = lower_bound(save.begin(), save.end(), id) - save.begin();
      k--;
      int tmp = save[k + 1] - save[k] - 1;
      if (tmp >= K - num[k]) {
        cnt0++;
        ans0 = ((ans0) < (val) ? (val) : (ans0));
        save[k]++;
        if (cnt0 == Q) {
          break;
        }
      }
    }
    if (i == n) {
      continue;
    }
    ans = ((ans) > (ans0 - tmp0) ? (ans0 - tmp0) : (ans));
  }
  printf("%lld\n", ans);
  return;
}
int main(int argc, char* argv[]) {
  solve();
  return 0;
}
