#include <bits/stdc++.h>
using namespace std;
const int N = 2002;
int A[N];
void check(vector<int> &v, vector<int> &v1, int k) {
  if (v.size() >= k) {
    sort(v.begin(), v.end());
    reverse(v.begin(), v.end());
    while (v.size() >= k) {
      v1.push_back(v.back());
      v.pop_back();
    }
  }
  v.clear();
}
int main() {
  int n, k, q;
  scanf("%d%d%d", &n, &k, &q);
  for (int i = 1; i < n + 1; i++) {
    scanf("%d", &A[i]);
  }
  int ans = 1000000009;
  for (int i = 1; i < n + 1; i++) {
    vector<int> v, v1;
    for (int j = 1; j < n + 1; j++) {
      if (A[j] < A[i]) {
        check(v, v1, k);
      } else {
        v.push_back(A[j]);
      }
    }
    check(v, v1, k);
    if (v1.size() >= q) {
      ans = min(ans, v1[q - 1] - v1[0]);
    }
  }
  printf("%d\n", ans);
  return 0;
}
