#include <bits/stdc++.h>
inline int getInt() {
  int s;
  scanf("%d", &s);
  return s;
}
using namespace std;
const int inf = 1 << 30;
int solve(const vector<int> &a, int k, int v, int q) {
  const int n = a.size();
  int cnt = 0;
  vector<vector<int> > t;
  for (int i = 0; i < n;) {
    if (a[i] > v) {
      i++;
      continue;
    }
    vector<int> tt;
    for (; i < n && a[i] <= v; i++) tt.push_back(a[i]);
    if (k - 1 <= (int)tt.size()) {
      sort(tt.begin(), tt.end());
      for (int j = 0; j < (int)(k - 1); j++) tt.pop_back();
      t.push_back(tt);
      cnt += tt.size();
    }
  }
  if (cnt < q) return inf;
  const int m = t.size();
  int mn = inf;
  for (int i = 0; i < (int)(m); i++) {
    const vector<int> &tt = t[i];
    mn = min(mn, tt[0]);
  }
  int ans = inf;
  for (int i = 0; i < (int)(m); i++) {
    const vector<int> &tt = t[i];
    ans = min(ans, tt[min((int)tt.size(), q) - 1] - tt[0]);
    if (mn != tt[0]) ans = min(ans, tt[min((int)tt.size(), q - 1) - 1] - mn);
  }
  return ans;
}
int main() {
  const int n = getInt();
  const int k = getInt();
  const int q = getInt();
  vector<int> a(n);
  for (int i = 0; i < (int)(n); i++) a[i] = getInt();
  int ans = inf;
  for (int i = 0; i < (int)(n); i++) ans = min(ans, solve(a, k, a[i], q));
  printf("%d\n", ans);
  return 0;
}
