#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<ll, ll>;
constexpr ll INF = 1LL << 62;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N, K, Q;
  cin >> N >> K >> Q;
  vector<ll> A(N);
  for (auto&& a : A) {
    cin >> a;
  }
  ll X = -1;
  ll Y = INF;
  for (ll q = 0; q < Q; q++) {
    vector<ll> backet(N - q, 0);
    for (ll i = 0; i < N - q - K + 1; i++) {
      ll mini = INF;
      ll idx = -1;
      for (ll k = 0; k < K; k++) {
        if (mini > A[i + k]) {
          mini = A[i + k];
          idx = i + k;
        }
      }
      backet[idx]++;
    }
    vector<ll> remove_idxes;
    ll maxi = -1;
    for (ll i = 0; i < N - q; i++) {
      if (maxi < backet[i]) {
        maxi = backet[i];
        remove_idxes.clear();
        remove_idxes.push_back(i);
      } else if (maxi == backet[i]) {
        remove_idxes.push_back(i);
      }
    }
    ll remove_idx;
    if (remove_idxes.size() == 1) {
      remove_idx = remove_idxes[0];
    } else {
      ll D = INF;
      for (ll j = 0; j < remove_idxes.size(); j++) {
        ll d = min(abs(X - A[remove_idxes[j]]), abs(Y - A[remove_idxes[j]]));
        if (d < D) {
          remove_idx = remove_idxes[j];
          D = d;
        } else if (d == D && A[remove_idxes[j]] > A[remove_idx]) {
          remove_idx = remove_idxes[j];
          D = d;
        }
      }
    }
    X = max(X, A[remove_idx]);
    Y = min(Y, A[remove_idx]);
    A.erase(A.begin() + remove_idx);
  }
  cout << X - Y << endl;
  return 0;
}
