#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int a[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int k;
  cin >> k;
  int q;
  cin >> q;
  vector<int> val;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    val.emplace_back(a[i]);
  }
  sort(val.begin(), val.end());
  val.erase(unique(val.begin(), val.end()), val.end());
  val.emplace_back(2e9);
  int ans = 1e9;
  for (int i = 0; i < (int)val.size() - 1; ++i) {
    vector<vector<int> > vec;
    vector<int> cur;
    for (int j = 1; j <= n; ++j) {
      if (a[j] < val[i]) {
        if (cur.size()) {
          vec.emplace_back(cur);
          cur.clear();
        }
        continue;
      }
      cur.emplace_back(a[j]);
    }
    if (cur.size()) vec.emplace_back(cur);
    for (vector<int> &V : vec) sort(V.begin(), V.end());
    int l = i;
    int r = (int)val.size() - 1;
    while (l < r) {
      int m = (l + r) / 2;
      int c = 0;
      for (vector<int> V : vec)
        c += upper_bound(V.begin(), V.end(), val[m]) - V.begin();
      if (c >= q)
        r = m;
      else
        l = m + 1;
    }
    if (ans > val[l] - val[i]) ans = val[l] - val[i];
  }
  cout << ans << endl;
}
