#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using ll = long long;
template <class T>
bool set_min(T &a, const T &b) {
  return a > b ? a = b, true : false;
}
template <class T>
bool set_max(T &a, const T &b) {
  return a < b ? a = b, true : false;
}
template <class T>
istream &operator>>(istream &is, vector<T> &v) {
  for (T &a : v) is >> a;
  return is;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (const T &t : v) os << "\t" << t;
  return os << endl;
}
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &v) {
  return os << "<" << v.first << ", " << v.second << ">";
}
const int INF = 1 << 30;
const ll INFL = 1LL << 60;
class Solver {
 public:
  bool solve() {
    int N, K, Q;
    cin >> N >> K >> Q;
    vector<int> A(N);
    cin >> A;
    vector<int> B = A;
    sort(B.begin(), B.end());
    B.erase(unique(B.begin(), B.end()), B.end());
    ll ans = INFL;
    for (int mini : B) {
      int cnt = 0;
      vector<int> vv;
      for (int l = 0; l < (int)(N); l++) {
        int r = l;
        while (r < N and A[r] >= mini) r++;
        if (r - l + 1 >= K) {
          cnt += r - l - K + 1;
          vector<int> v;
          for (int j = (l); j < (int)(r); j++) v.push_back(A[j]);
          sort(v.begin(), v.end());
          for (int j = 0; j < (int)(r - l - K + 1); j++) vv.push_back(v[j]);
        }
        while (r < N and A[r] < mini) r++;
        l = r;
      }
      if (cnt >= Q) {
        sort(vv.begin(), vv.end());
        int mx = vv[Q - 1];
        assert(mx >= mini);
        set_min<ll>(ans, mx - mini);
      }
    }
    cout << ans << endl;
    return 0;
  }
};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  Solver s;
  s.solve();
  return 0;
}
