#include <bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &x) {
  x = 0;
  char c;
  for (c = getchar(); !isdigit(c); c = getchar())
    ;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
}
const int N = 2005;
int n, k, q, a[N], b[N], c[N], m, ans = 1e9;
vector<int> v, g;
int main(int argc, char *argv[]) {
  read(n), read(k), read(q);
  for (int i = 1; i <= (n); ++i) {
    read(a[i]);
    b[i] = a[i];
  }
  m = n;
  sort(b + 1, b + m + 1);
  m = unique(b + 1, b + m + 1) - b - 1;
  for (int d = 0; d <= (m); ++d) {
    int x = b[d];
    ;
    memset(c, 0, sizeof(c));
    for (int i = 1; i <= (n); ++i) {
      if (a[i] == x) {
        ++c[max(1, i - (k - 1))];
        --c[min(n + 1, i + k)];
        ;
      }
    }
    v.clear(), g.clear();
    c[n + 1] += N;
    for (int i = 1; i <= (n + 1); ++i) {
      c[i] += c[i - 1];
      ;
      if (c[i] == 0)
        v.push_back(a[i]);
      else {
        sort(v.begin(), v.end());
        for (size_t j = 0; j + k <= v.size(); ++j) g.push_back(v[j]);
        v.clear();
      }
    }
    if ((int)g.size() < q) break;
    sort(g.begin(), g.end());
    (ans > g[q - 1] - g[0] ? ans = g[q - 1] - g[0] : ans);
  }
  printf("%d\n", ans);
  return 0;
}
