#include <bits/stdc++.h>
using namespace std;
int n, k, q;
int a[2005], b[2005];
set<pair<int, int> > s;
int main() {
  scanf("%d%d%d", &n, &k, &q);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]), b[i] = a[i];
  sort(b + 1, b + n + 1);
  int Sol = b[n] - b[1];
  for (int i = 1; i <= n; ++i) {
    int v = b[i], st = i, dr = n;
    while (st <= dr) {
      int mij = (st + dr) / 2;
      int nrop = 0;
      for (int i = 1; i < k; ++i) s.insert({a[i], i});
      for (int i = k; i <= n; ++i) {
        s.insert({a[i], i});
        int x = s.begin()->first;
        if (x < v || x > b[mij])
          s.erase(s.begin());
        else {
          ++nrop, s.erase(s.begin());
          if (nrop == q) break;
        }
      }
      if (nrop >= q)
        dr = mij - 1;
      else
        st = mij + 1;
    }
    if (st <= n) Sol = min(Sol, b[st] - b[i]);
  }
  printf("%d", Sol);
  return 0;
}
