#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  V<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  V<int> a_buf = a;
  V<int> idx(n);
  iota(begin(idx), end(idx), 0);
  sort(begin(idx), end(idx), [&](int x, int y) { return a[x] < a[y]; });
  int ans = TEN(9) + TEN(7);
  V<bool> vis(n, true);
  for (int s : idx) {
    int l = 0;
    V<int> v;
    while (l < n) {
      if (!vis[l]) {
        l++;
        continue;
      }
      int r = l + 1;
      while (r < n && vis[r]) r++;
      sort(begin(a) + l, begin(a) + r);
      for (int i = 0; i < r - l - (k - 1); i++) {
        v.push_back(a[l + i]);
      }
      l = r;
    }
    vis[s] = false;
    sort(begin(v), end(v));
    if (int(v.size()) < q) continue;
    ans = min(ans, v[q - 1] - a_buf[s]);
  }
  cout << ans << endl;
  return 0;
}
