#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, K, Q;
  cin >> N >> K >> Q;
  int A[N];
  for (int i = (0); i < (N); ++i) cin >> A[i];
  int ans = 1e9;
  for (int i = (0); i < (N); ++i) {
    vector<int> v;
    priority_queue<int, vector<int>, greater<int> > que;
    for (int j = (0); j < (N); ++j) {
      if (A[j] >= A[i]) que.push(A[j]);
      if (A[j] < A[i] || j == N - 1) {
        int k = 0;
        while (!que.empty()) {
          int q = que.top();
          que.pop();
          if (k < Q) {
            v.push_back(q);
          }
          k++;
        }
      }
    }
    if (v.size() < Q) continue;
    sort(v.begin(), v.end());
    ans = min(ans, v[Q - 1] - v[0]);
  }
  cout << ans << endl;
}
