#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(N);
  for (int i = 0; i < N; ++i) cin >> A[i];
  int ret = (1 << 30);
  for (int i = 0; i < N; ++i) {
    vector<int> candy, cur;
    for (int j = 0; j <= N; j++) {
      if (j == N || A[j] < A[i]) {
        sort(cur.begin(), cur.end());
        if (cur.size() >= K)
          candy.insert(candy.end(), cur.begin(), cur.end() - K);
        cur.clear();
      } else
        cur.push_back(A[j]);
    }
    sort(candy.begin(), candy.end());
    if (candy.size() >= Q) ret = min(ret, candy[Q - 1] - A[i]);
  }
  cout << ret << '\n';
  return 0;
}
