#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << '\n';
  err(++it, args...);
}
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &a) {
  return os << '(' << a.first << ", " << a.second << ')';
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &a) {
  os << '[';
  for (unsigned int i = 0; i < a.size(); i++)
    os << a[i] << (i < a.size() - 1 ? ", " : "");
  os << ']';
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const set<T> &a) {
  os << '{';
  for (typename set<T>::iterator it = a.begin(); it != a.end(); it++) {
    typename set<T>::iterator jt = it;
    os << *it << (++jt != a.end() ? ", " : "");
  }
  os << '}';
  return os;
}
template <class T1, class T2>
ostream &operator<<(ostream &os, map<T1, T2> &a) {
  os << "{\n";
  for (typename map<T1, T2>::iterator it = a.begin(); it != a.end(); it++) {
    typename map<T1, T2>::iterator jt = it;
    os << "  " << it->first << ": " << it->second
       << (++jt != a.end() ? ",\n" : "\n");
  }
  os << '}';
  return os;
}
int n, m, q;
vector<int> a;
vector<int> allVal;
multiset<pair<int, int> > mstVal;
multiset<int> mstPos;
bool check(int lo, int hi) {
  mstPos.clear();
  mstVal.clear();
  int remQ = q;
  for (int i = 0; i < n; i++) {
    mstVal.insert(make_pair(a[i], i));
    mstPos.insert(i);
    if (remQ == 0) return true;
    if (mstVal.size() == m) {
      if (lo <= mstVal.begin()->first && mstVal.begin()->first <= hi) {
        mstPos.erase(mstVal.begin()->second);
        mstVal.erase(mstVal.begin());
        remQ--;
      } else {
        mstVal.erase(make_pair(a[*mstPos.begin()], *mstPos.begin()));
        mstPos.erase(mstPos.begin());
      }
    }
  }
  if (remQ == 0) return true;
  return false;
}
const int INF = 2e9;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    a.push_back(t);
    allVal.push_back(t);
  }
  sort(allVal.begin(), allVal.end());
  allVal.resize(distance(allVal.begin(), unique(allVal.begin(), allVal.end())));
  int ans = INF;
  int it = 0;
  for (int hi = 0; hi < allVal.size(); hi++) {
    while (it < hi) {
      if (check(allVal[it], allVal[hi])) {
        ans = min(ans, allVal[hi] - allVal[it]);
        it++;
      } else
        break;
    }
  }
  cout << ans << '\n';
}
