#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007, MAX = 2001, INF = 1 << 30;
int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(N), B(N - K + 1);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  deque<int> deq(N);
  int s = 0, t = 0;
  for (int i = 0; i < N; i++) {
    while (s < t && A[deq[t - 1]] >= A[i]) t--;
    deq[t] = i;
    t++;
    if (i - K + 1 >= 0) {
      B[i - K + 1] = A[deq[s]];
      if (deq[s] == i - K + 1) s++;
    }
  }
  int ans = INF;
  if (Q == 1)
    cout << 0 << endl;
  else {
    for (int i = 0; i < N; i++) {
      bool flag = false;
      if (N - i < Q) continue;
      for (int j = i - K + 1; j <= i; j++) {
        if (j < 0) continue;
        if (B[j] == A[i]) {
          flag = true;
          break;
        }
      }
      if (!flag) continue;
      vector<int> S, T;
      for (int j = 0; j < N; j++) {
        if (i == j) continue;
        if (A[j] < A[i]) {
          if (S.size() < K)
            vector<int> S;
          else {
            sort((S).begin(), (S).end());
            for (int k = 0; k <= S.size() - K; k++) {
              T.push_back(S[k]);
            }
            vector<int> S;
          }
        } else {
          S.push_back(A[j]);
        }
      }
      if (S.size() >= K) {
        sort((S).begin(), (S).end());
        for (int k = 0; k <= S.size() - K; k++) {
          T.push_back(S[k]);
        }
      }
      if (T.size() < Q - 1) continue;
      sort((T).begin(), (T).end());
      ans = min(ans, T[Q - 2] - A[i]);
    }
    cout << ans << endl;
  }
}
