#include <bits/stdc++.h>
using namespace std;
long long a[2005];
multiset<long long> se1;
multiset<long long>::iterator it;
pair<long long, long long> a1[2005];
vector<set<long long> > se(2005);
set<long long>::iterator it1;
int main() {
  std::ios::sync_with_stdio(false);
  long long n, k, q, ans = (1000 * 1000 * 1000 + 5), i, val, val1, r, j,
                     minn = (1000 * 1000 * 1000 + 5);
  cin >> n >> k >> q;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    a1[i].first = a[i];
    a1[i].second = i;
  }
  for (i = 0; i < n; i++) {
    val = i - k + 1;
    val = max(val, 0LL);
    minn = (1000 * 1000 * 1000 + 5);
    se1.clear();
    for (j = val; j < val + k; j++) {
      minn = min(minn, a[j]);
      se1.insert(a[j]);
    }
    r = val + k - 1;
    se[i].insert(minn);
    for (j = val + 1; j < i + 1; j++) {
      if (r + 1 >= n) {
        break;
      }
      it = se1.find(a[j - 1]);
      se1.erase(it);
      se1.insert(a[r + 1]);
      val1 = *se1.begin();
      se[i].insert(val1);
      r++;
    }
  }
  sort(a1, a1 + n);
  for (i = 0; i < n - k + 1; i++) {
    if (i + q - 1 < n - k + 1) {
      if (i > 0) {
        val = a[i - 1];
      } else {
        val = 0;
      }
      for (j = i; j < i + q; j++) {
        it1 = se[a1[j].second].upper_bound(val);
        if (it1 == se[j].end()) {
          break;
        }
      }
      if (j == i + q) {
        ans = min(ans, a1[i + q - 1].first - a1[i].first);
      }
    }
  }
  cout << ans << endl;
}
