#include <bits/stdc++.h>
using namespace std;
long long solve(vector<vector<pair<int, int> > > As, long long K, long long Q) {
  long long i, j;
  vector<pair<int, int> > nums;
  for (i = (0); i < (int((As).size())); ++i) {
    sort((As[i]).begin(), (As[i]).end());
    for (j = (0); j < (int((As[i]).size()) - (K - 1)); ++j) {
      nums.push_back(As[i][j]);
    }
  }
  if (int((nums).size()) < Q) {
    return -1;
  }
  sort((nums).begin(), (nums).end());
  return nums[Q - 1].first - nums[0].first;
}
int main(int argc, char *argv[]) {
  long long N, K, Q, i, j;
  cin >> N >> K >> Q;
  vector<int> A(N);
  vector<pair<int, int> > Ap(N);
  for (i = (0); i < (N); ++i) {
    cin >> A[i];
    Ap[i].first = A[i];
    Ap[i].second = i;
  }
  vector<pair<int, int> > Ap0 = Ap;
  sort((Ap).begin(), (Ap).end());
  if (Q == 1) {
    cout << 0 << endl;
  } else {
    long long ans = Ap.back().first - Ap[0].first;
    vector<vector<pair<int, int> > > As(1, Ap);
    map<long long, pair<int, int> > mp;
    for (i = (0); i < (N); ++i) {
      mp[i] = pair<int, int>(0, i);
    }
    for (i = (0); i < (N); ++i) {
      long long s = solve(As, K, Q);
      if (s < 0) {
        break;
      }
      ans = min(ans, s);
      pair<int, int> pos = mp[i];
      if (pos.second > K - 1) {
        vector<pair<int, int> > As1(
            As[pos.first].begin(),
            As[pos.first].begin() + pos.second - (K - 1));
        for (j = (0); j < (int((As1).size())); ++j) {
          mp[As1[j].second] = pair<int, int>(int((As).size()), j);
        }
        As.push_back(As1);
      }
      if (pos.second + K < int((As[pos.first]).size())) {
        vector<pair<int, int> > As2(
            As[pos.first].begin() + pos.second + (K - 1), As[pos.first].end());
        for (j = (0); j < (int((As2).size())); ++j) {
          mp[As2[j].second] = pair<int, int>(int((As).size()), j);
        }
        As.push_back(As2);
      }
      As[pos.first].clear();
    }
    cout << ans << endl;
  }
  return 0;
}
