#include <bits/stdc++.h>
using namespace std;
int n, k1, q;
int a[2005];
int b[2005];
int x[2005];
int ans = 0x7f;
int f[2005][12];
void rmq() {
  for (int i = 1; i <= n; i++) {
    f[i][0] = a[i];
  }
  for (int j = 1; (1 << j) <= n; j++) {
    for (int i = 1; i + (1 << j) - 1 <= n; i++) {
      f[i][j] = min(f[i][j - 1], f[i + (1 << (j - 1))][j - 1]);
    }
  }
  return;
}
int init(int s, int r) {
  int k = log(r - s + 1) / log(2);
  return min(f[s][k], f[r - (1 << k) + 1][k]);
}
int main() {
  cin >> n >> k1 >> q;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b + 1, b + 1 + n);
  rmq();
  int w = 1, tot = 0;
  for (int i = 1; i <= n; i++) {
    int y = b[i], l = 0;
    bool t = 0;
    w = 1;
    tot = 0;
    memset(x, 0x7f, sizeof(x));
    for (int j = 1; j <= n + 1; j++) {
      if (a[j] < y) {
        tot = 0;
        if (t == 1) {
          sort(a + 1 + w, a + j);
          if (j == n + 1) {
            for (int k = w; k <= j - k1; k++) {
              l++;
              x[l] = a[k];
            }
          } else {
            for (int k = w; k <= j - k1 + 1; k++) {
              l++;
              x[l] = a[k];
            }
          }
          t = 0;
        }
        w = j + 1;
      } else {
        tot++;
        if (tot == k1) {
          t = 1;
        }
      }
    }
    sort(x + 1, x + 1 + n);
    ans = min(ans, x[q] - y);
  }
  cout << ans;
  return 0;
}
