#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 5;
int n, k, q, a[N], res;
vector<int> tmp1, tmp2, v;
void trans() {
  if ((int)tmp1.size() >= k) {
    sort(tmp1.begin(), tmp1.end());
    for (int i = 0; i < (int)tmp1.size() - k + 1; ++i) tmp2.push_back(tmp1[i]);
  }
  tmp1.clear();
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k >> q;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    v.push_back(a[i]);
  }
  sort(v.begin(), v.end());
  res = v.back() - v[0];
  for (int i = 0; i < n; ++i)
    if (i == 0 || v[i] != v[i - 1]) {
      int bound = v[i];
      tmp1.clear();
      tmp2.clear();
      int l = 1;
      for (int j = 1; j <= n; ++j) {
        if (a[j] >= bound)
          tmp1.push_back(a[j]);
        else
          trans();
      }
      trans();
      if ((int)tmp2.size() >= q)
        res = min(res, tmp2[q - 1] - tmp2[0]);
      else
        break;
    }
  cout << res;
}
