#include <bits/stdc++.h>
using namespace std;
int n, k1, q;
long long a[2005];
long long b[2005];
long long x[2005];
long long ans = 9999999999;
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);
  int w = 1, tot = 0;
  for (int i = 1; i <= n; i++) {
    long long 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;
}
