#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long i, j, k, n, ans = 10e18, q;
  scanf("%lld%lld%lld", &n, &k, &q);
  long long a[n], b[n];
  for (i = 0; i < n; ++i) {
    scanf("%lld", &a[i]);
  }
  for (i = 0; i < n; ++i) {
    set<long long> s;
    set<long long>::iterator it;
    for (j = i; j < n; ++j) {
      if (a[i] <= a[j]) s.insert(a[j]);
    }
    if (s.size() >= q) {
      it = s.begin();
      for (i = 0; i < q; ++i) it++;
      if ((*it) - a[i] < ans) ans = (*it) - a[i];
    }
  }
  printf("%lld", ans);
  return 0;
}
