#include <bits/stdc++.h>
using namespace std;
int in[2005];
pair<int, int> pp[2005];
bool isErased[2005];
bool isPossible(int n, int k, int q) {
  isErased[n + 1] = true;
  int last = 1, ret = 0;
  for (int i = 1; i <= n + 1; ++i) {
    if (isErased[i]) {
      if (i - last >= k) {
        ret += i - last - k + 1;
      }
      last = i + 1;
    }
  }
  if (ret >= q) {
    return true;
  } else {
    return false;
  }
}
void solve() {
  int n, k, q;
  scanf("%d %d %d", &n, &k, &q);
  if (q == 1) {
    printf("0\n");
    return;
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &in[i]);
    pp[i] = make_pair(in[i], i);
  }
  sort(pp + 1, pp + n + 1);
  int ret = 1e9;
  for (int i = 1; i <= n;) {
    int j;
    vector<int> v;
    for (j = i; j <= n; ++j) {
      if (pp[j].first != pp[i].first) {
        break;
      }
      v.push_back(pp[j].second);
    }
    if (isPossible(n, k, q)) {
      ret = min(ret, pp[i + q - 1].first - pp[i].first);
    }
    i = j;
    for (j = 0; j < v.size(); ++j) {
      isErased[v[j]] = true;
    }
  }
  printf("%d\n", ret);
}
int main() {
  solve();
  return 0;
}
