#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N, K, Q;
  cin >> N >> K >> Q;
  vector<long long> A(2010);
  long long a2[2010];
  for (long long i = (0); i < (N); i++) cin >> A[i];
  for (long long i = (0); i < (N); i++) a2[i] = A[i];
  sort(a2, a2 + N);
  long long ans = INF;
  for (long long i = (0); i < (N); i++) {
    long long X = A[i];
    bool ok[2010];
    for (long long j = (0); j < (N); j++) {
      if (A[j] < X) {
        ok[j] = false;
      } else {
        ok[j] = true;
      }
    }
    vector<long long> pos;
    long long v = 0;
    for (long long j = (0); j < (N); j++) {
      if (not ok[j]) {
        if (v != 0) pos.push_back(v);
        v = 0;
      } else {
        v++;
      }
    }
    if (v != 0) pos.push_back(v);
    long long cnt = 0;
    for (long long j = (0); j < (pos.size()); j++) {
      cnt += max(0LL, pos[j] - K + 1);
    }
    if (cnt >= Q) {
      long long p1 = lower_bound(a2, a2 + N, X) - a2;
      long long Y = a2[p1 + Q - 1];
      ans = min(ans, Y - X);
    }
  }
  cout << (ans) << endl;
  ;
}
