#include <bits/stdc++.h>
using namespace std;
int n;
int k;
int nQuery;
int vs[2000 + 10];
struct K {
  vector<int> sorted;
  int used = 0;
};
bool operator>(const K& k1, const K& k2) { return k1.sorted[0] > k2.sorted[0]; }
int main(void) {
  scanf("%d%d%d", &n, &k, &nQuery);
  set<int> ss;
  ss.insert(0);
  for (int i = 0; i < (int)(n); ++i) {
    scanf("%d", &vs[i]);
    ss.insert(vs[i]);
  }
  int res = 2000000000;
  for (int v : ss) {
    priority_queue<K, vector<K>, greater<K> > q;
    {
      int lastOmit = -1;
      vector<int> sorted;
      for (int i = 0; i < (int)(n); ++i) {
        if (vs[i] <= v) {
          K r;
          r.used = 0;
          if ((int)sorted.size() >= k) {
            sort(sorted.begin(), sorted.end());
            r.sorted = sorted;
            q.push(r);
          }
          lastOmit = i;
          sorted.clear();
        } else {
          sorted.push_back(vs[i]);
        }
      }
      K r;
      r.used = 0;
      if ((int)sorted.size() >= k) {
        sort(sorted.begin(), sorted.end());
        r.sorted = sorted;
        q.push(r);
      }
    }
    int maxi = -1;
    int mini = 2000000000;
    int cnt = 0;
    while (cnt < nQuery && !q.empty()) {
      K cur = q.top();
      q.pop();
      int curV = cur.sorted[cur.used];
      maxi = max(maxi, curV);
      mini = min(mini, curV);
      cur.used++;
      if ((int)cur.sorted.size() - cur.used >= k) {
        q.push(cur);
      }
      ++cnt;
    }
    if (cnt == nQuery) {
      int cur = maxi - mini;
      res = min(res, cur);
    } else {
      break;
    }
  }
  printf("%d\n", res);
  return 0;
}
