#include <bits/stdc++.h>
using namespace std;
priority_queue<int, vector<int>, greater<int> > que1;
priority_queue<int, vector<int>, greater<int> > que2;
int n, q, k, ans = 1e9;
int a[2005], minn[2005], p[2005];
void clear(int opt) {
  if (opt == 1)
    while (!que1.empty()) que1.pop();
  else
    while (!que2.empty()) que2.pop();
}
int minx(int a1, int b1) { return a1 < b1 ? a1 : b1; }
bool check(int t) {
  int c = 0, mes = 1, ct = 0;
  bool ret = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] >= t) {
      c++;
      if (a[i] == t) mes = 0;
    }
    if (c >= k) {
      ct++;
      if (mes == 0) ret = 1;
    }
    if (a[i] < t) c = 0, mes = 1;
  }
  if (ret == 1 && ct >= q)
    ret = 1;
  else
    ret = 0;
  return ret;
}
int main() {
  scanf("%d%d%d", &n, &k, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    minn[i] = a[i];
  }
  sort(minn + 1, minn + 1 + n);
  for (int i = 1; i <= n; i++) {
    clear(2);
    if (!check(minn[i]))
      continue;
    else {
      for (int j = 1; j <= n; j++) {
        if (a[j] >= minn[i]) que1.push(a[j]);
        if (a[j] < minn[i]) {
          if (que1.size() >= k) {
            printf("%d\n", que1.size());
            while (!que1.empty()) {
              int p = que1.top();
              que2.push(p);
              que1.pop();
            }
          } else
            clear(1);
        }
      }
      if (que1.size() >= k) {
        while (!que1.empty()) {
          int p = que1.top();
          que2.push(p);
          que1.pop();
        }
      } else
        clear(1);
      int tot = 0;
      while (tot < q - 1) {
        tot++;
        que2.pop();
      }
      int t = que2.top();
      ans = minx(t - minn[i], ans);
    }
  }
  printf("%d", ans);
  return 0;
}
