#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, q;
  int a[100010];
  vector<pair<int, int> > vec;
  scanf("%d%d%d", &n, &k, &q);
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
    vec.push_back({a[i], i});
  }
  a[n] = -1;
  sort(vec.begin(), vec.end());
  int ans = 1000000000;
  for (int i = 0; i < n - k; i++) {
    vector<int> vec2, vec3;
    int l = 0, low = 0;
    for (int j = 0; j <= n; j++) {
      if (a[j] >= vec[i].first) {
        low++;
        vec2.push_back(a[j]);
      } else {
        int size = min((j - l) - k + 1, low);
        sort(vec2.begin(), vec2.end());
        for (int l = 0; l < size; l++) vec3.push_back(vec2[l]);
        vec2 = vector<int>();
        l = j + 1;
        low = 0;
      }
    }
    if (vec3.size() >= q) {
      sort(vec3.begin(), vec3.end());
      ans = min(ans, vec3[q - 1] - vec[i].first);
    }
  }
  cout << ans << endl;
  return 0;
}
