#include <bits/stdc++.h>
using namespace std;
template <typename T>
void readvec(vector<T> &a);
void readindex(vector<long long> &a);
signed main() {
  long long N, K, Q;
  cin >> N >> K >> Q;
  vector<long long> A(N);
  readvec(A);
  set<long long> s;
  for (long long i = (0); i < (N); i++) {
    s.insert(A[i]);
  }
  long long ans = 10000000000;
  for (long long a : s) {
    vector<long long> smalln(0), tmp(0);
    for (long long i = (0); i < (N); i++) {
      if (A[i] >= a) tmp.push_back(A[i]);
      if (A[i] < a || i == N - 1) {
        if (tmp.size() >= K) {
          sort(tmp.begin(), tmp.end());
          for (long long j = (0); j < (tmp.size() - K + 1); j++)
            smalln.push_back(tmp[j]);
        }
      }
    }
    if (smalln.size() >= Q) {
      sort(smalln.begin(), smalln.end());
      ans = min(ans, smalln[Q - 1] - smalln[0]);
    }
  }
  cout << ans;
  return 0;
}
template <typename T>
void readvec(vector<T> &a) {
  for (long long i = (0); i < (a.size()); i++) {
    cin >> a[i];
  }
}
void readindex(vector<long long> &a) {
  for (long long i = (0); i < (a.size()); i++) {
    cin >> a[i];
    a[i]--;
  }
}
