#include <bits/stdc++.h>
using namespace std;
template <class T>
void debug(T itr1, T itr2) {
  auto now = itr1;
  while (now < itr2) {
    cout << *now << " ";
    now++;
  }
  cout << endl;
}
const long long MOD = pow(10, 9) + 7;
const long long LLINF = pow(2, 61) - 1;
const int INF = pow(2, 30) - 1;
int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  long long A[N];
  for (int i = (int)0; i < (int)N; i++) cin >> A[i];
  long long result = INF;
  for (int i = (int)0; i < (int)N; i++) {
    vector<long long> num, now;
    for (int j = (int)0; j < (int)N + 1; j++) {
      if (j != i && j != N && A[j] >= A[i])
        now.push_back(A[j]);
      else if (j != i) {
        sort(now.begin(), now.end());
        for (int i = (int)0; i < (int)now.size() - K + 1; i++)
          num.push_back(now[i]);
        now.clear();
      }
    }
    sort(num.begin(), num.end());
    if (num.size() >= Q - 1) result = min(result, num[Q - 2] - A[i]);
  }
  cout << result << endl;
  return 0;
}
