#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<bool> b(n, true);
  vector<P> s(n);
  for (int i = 0; i < n; i++) {
    s[i].first = a[i];
    s[i].second = i;
  }
  sort(s.begin(), s.end());
  int res = 2e9;
  for (int i = 0; i < n - k + 1; i++) {
    vector<int> c;
    int l = 0, r = 1;
    while (r < n) {
      while (r < n and b[r]) r++;
      vector<int> tmp;
      tmp.assign(a.begin() + l, a.begin() + r);
      sort(tmp.begin(), tmp.end());
      for (int j = 0; j < r - l - k + 1; j++) {
        c.push_back(tmp[j]);
      }
      if (r == n) break;
      l = r;
      while (l < n and not b[l]) l++;
      r = l + 1;
    }
    if (c.size() < q) continue;
    sort(c.begin(), c.end());
    res = min(res, c[q - 1] - c[0]);
    b[s[i].second] = false;
  }
  cout << res << '\n';
  return 0;
}
