#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
using P = pair<int, int>;
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod2 = 998244353;
const int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  vector<int> S = A;
  sort(S.begin(), S.end());
  int ans = S[Q - 1] - S[0];
  S.erase(unique(S.begin(), S.end()), S.end());
  for (int ng = 0; ng < S.size(); ng++) {
    vector<int> ok;
    priority_queue<int> que;
    for (int i = 0; i < N; i++) {
      if (A[i] <= ng) {
        while (que.size()) {
          if (que.size() > K) ok.emplace_back(que.top());
          que.pop();
        }
      } else {
        que.emplace(A[i]);
      }
    }
    sort(ok.begin(), ok.end());
    if (ok.size() >= Q) {
      chmin(ans, ok[Q - 1] - ok[0]);
    }
  }
  cout << ans << "\n";
  return 0;
}
