#include <bits/stdc++.h>
using namespace std;
int n, k, q, ans;
int a[2005];
vector<int> o;
bool x = true;
int main(void) {
  cin >> n >> k >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    o.push_back(a[i]);
  }
  sort(o.begin(), o.end());
  ans = o[q - 1] - o[0];
  for (int i = 0; i < n && x; i++) {
    vector<int> y, z;
    for (int j = 0; j < n; j++) {
      if (a[j] <= o[i]) {
        if (z.size() >= k) {
          sort(z.begin(), z.end());
          for (int l = 0; l <= z.size() - k; l++) y.push_back(z[l]);
        }
        z.clear();
      } else
        z.push_back(a[j]);
    }
    if (y.size() < q)
      x = false;
    else {
      sort(y.begin(), y.end());
      ans = min(ans, y[q - 1] - y[0]);
    }
  }
  printf("%d\n", ans);
}
