#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const long long int mod = 1e9 + 7, INF = 1e18;
long long int dx[8] = {0, -1, 1, 0, 1, -1, 1, -1},
              dy[8] = {1, 0, 0, -1, -1, -1, 1, 1};
long long int N, K, Q, arr[2000];
set<long long int> st;
int main() {
  cin >> N >> K >> Q;
  for (long long int i = (0), i_end_ = (N); i < i_end_; i++) {
    cin >> arr[i];
    st.insert(arr[i]);
  }
  long long int minv = INF;
  for (auto itr : st) {
    long long int border = itr, cnt = 0, _cnt = 0;
    priority_queue<long long int, vector<long long int>, greater<long long int>>
        que;
    for (long long int i = (0), i_end_ = (N); i < i_end_; i++) {
      if (arr[i] >= border) {
        cnt++;
      } else {
        if (cnt >= K) {
          for (long long int j = (0), j_end_ = (cnt); j < j_end_; j++) {
            que.push(arr[i - j]);
          }
          _cnt += cnt - K + 1;
        }
        cnt = 0;
      }
    }
    if (cnt >= K) {
      for (long long int j = (0), j_end_ = (cnt); j < j_end_; j++) {
        que.push(arr[N - 1 - j]);
      }
      _cnt += cnt - K + 1;
    }
    if (_cnt < Q) continue;
    long long int _min = que.top();
    for (long long int i = (0), i_end_ = (Q - 1); i < i_end_; i++) {
      que.pop();
    }
    chmin(minv, que.top() - _min);
  }
  cout << minv << '\n';
}
