#include <bits/stdc++.h>
using namespace std;
int N, K, Q;
int A[2001];
int main(int argc, char** argv) {
  std::ios::sync_with_stdio(false);
  cin >> N >> K >> Q;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  int ans = 1e9 + 1;
  for (int i = 0; i < N; i++) {
    int lo = A[i];
    vector<int> smallest;
    int l = 0, r;
    while (l < N) {
      while (l < N && A[l] < lo) l++;
      if (l == N) break;
      r = l;
      vector<int> V;
      while (r < N && A[r] >= lo) {
        V.push_back(A[r]);
        r++;
      }
      sort(V.begin(), V.end());
      for (int k = 0; k < V.size() - K + 1; k++) smallest.push_back(V[k]);
      l = r;
    }
    sort(smallest.begin(), smallest.end());
    if (smallest.size() >= Q) ans = min(ans, smallest[Q - 1] - smallest[0]);
  }
  cout << ans << endl;
  return 0;
}
