#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 5;
int n, k, q, a[N];
pair<int, int> aa[N];
vector<int> rmv[N];
bool is[N];
int vid, vis[N], mx, mn;
int dfs(int i) {
  if (is[i]) return 1e8;
  if (vis[i] == vid) return 0;
  mx = max(mx, a[i]);
  mn = min(mn, a[i]);
  int ret = 1;
  vis[i] = vid;
  for (int ch : rmv[i]) ret += dfs(ch);
  return ret;
}
int main() {
  cin >> n >> k >> q;
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
    aa[i] = {a[i], i};
  }
  for (int i = 0; i < n; ++i) {
    int ii = i, jj = i;
    int c = 1;
    bool brk = 1;
    while (c < k) {
      int ajj = -1e9, aii = -1e9;
      if (jj + 1 < n) ajj = a[jj + 1], brk = 0;
      if (ii - 1 >= 0) aii = a[ii - 1], brk = 0;
      if (brk) break;
      brk = 1;
      if (ajj >= aii) {
        if (ajj >= a[i])
          ++c;
        else
          rmv[i].push_back(jj + 1);
        ++jj;
      } else {
        if (aii >= a[i])
          ++c;
        else
          rmv[i].push_back(ii - 1);
        --ii;
      }
    }
    if (c != k) {
      is[i] = 1;
      continue;
    }
    sort(rmv[i].begin(), rmv[i].end());
  }
  sort(aa, aa + n);
  int ans = 2e9 + 5;
  for (int i = 0; i + q - 1 < n; ++i) {
    if (is[i]) continue;
    int cnt = 0;
    ++vid;
    mx = -1e9 - 5, mn = 1e9 + 5;
    for (int j = i; cnt < q && j < n; ++j) {
      if (is[j]) continue;
      cnt += dfs(aa[j].second);
    }
    if (cnt == q) {
      ans = min(ans, mx - mn);
    }
  }
  cout << ans;
  return 0;
}
