#include <bits/stdc++.h>
using namespace std;
int n, range, req, lis[2222], ans, cnt, deact[2222];
pair<int, int> sor[2222];
vector<int> v, tmp;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> range >> req;
  for (long long i = (0); i <= ((long long)(n)-1); i++)
    cin >> lis[i], sor[i] = {lis[i], i};
  sort(sor, sor + n);
  ans = sor[req - 1].first - sor[0].first;
  cnt = n - range + 1;
  for (long long l = (1); l <= (n - 1); l++) {
    int ind = sor[l - 1].second;
    deact[ind] = 1;
    v.clear();
    for (long long i = (0); i <= ((long long)(n)-1); i++) {
      if (deact[i]) {
        sort(tmp.begin(), tmp.end());
        for (int j = 0; j + range - 1 < tmp.size(); j++) v.push_back(tmp[j]);
        tmp.clear();
      } else
        tmp.push_back(lis[i]);
    }
    sort(tmp.begin(), tmp.end());
    for (int j = 0; j + range - 1 < tmp.size(); j++) v.push_back(tmp[j]);
    tmp.clear();
    sort(v.begin(), v.end());
    for (int i = 0; i + req - 1 < v.size(); i++)
      ans = min(ans, v[i + req - 1] - v[i]);
  }
  cout << ans;
}
