#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 10, inf = 1e9 + 42;
int a[N], rev[N];
map<int, int> mp;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    mp[a[i]];
  }
  int nxt = 0;
  for (auto &i : mp) {
    i.second = nxt++;
    rev[i.second] = i.first;
  }
  for (int i = 1; i <= n; ++i) {
    a[i] = mp[a[i]];
  }
  int best = inf;
  for (int sm = 0; sm < nxt; ++sm) {
    int l = sm, r = nxt - 1;
    while (l <= r) {
      int lr = (l + r) / 2;
      int ctr = 0, cur = 0, good = 0;
      for (int i = 1; i <= n; ++i) {
        if (a[i] >= sm) {
          ++cur;
          if (a[i] <= lr) {
            ++good;
          }
        } else {
          ctr += max(0, min(good, cur - k + 1));
          cur = 0;
        }
      }
      ctr += max(0, min(good, cur - k + 1));
      if (ctr >= q) {
        r = lr - 1;
      } else {
        l = lr + 1;
      }
    }
    if (r == nxt - 1) {
      break;
    } else {
      best = min(best, rev[r + 1] - rev[sm]);
    }
  }
  cout << best;
}
