#include <bits/stdc++.h>
using namespace std;
signed main(void) {
  long long N, K, Q;
  long long A[2019];
  vector<long long> c;
  multiset<long long> q;
  cin >> N >> K >> Q;
  for (long long i = 0; i < (N); ++i) {
    cin >> A[i];
  }
  long long Ans = 1145141919810893364;
  for (long long i = 0; i < (N); ++i) {
    c.clear();
    for (long long j = 0; j < (N); ++j) {
      if (A[j] >= A[i]) {
        c.push_back(A[j]);
      }
      if (A[j] < A[i] || j == N - 1) {
        long long m = c.size();
        sort(c.begin(), c.end());
        for (long long k = 0; k < (m - K + 1); ++k) {
          q.insert(c[k]);
        }
        c.clear();
      }
    }
    long long p = q.size();
    if (p < Q) {
      continue;
    }
    auto it = q.begin();
    for (long long j = 0; j < (Q - 1); ++j) {
      it++;
    }
    if (*it != A[i]) {
      Ans = min(Ans, *it - A[i]);
    }
    q.clear();
  }
  cout << Ans << endl;
  return 0;
}
