#include <bits/stdc++.h>
using namespace std;
template <class T>
struct rge {
  T b, e;
};
template <class T>
rge<T> range(T i, T j) {
  return rge<T>{i, j};
}
struct debug {
  template <class T>
  debug& operator<<(const T&) {
    return *this;
  }
};
using ll = long long;
template <typename T>
void min_self(T& a, T b) {
  a = min(a, b);
}
template <typename T>
void max_self(T& a, T b) {
  a = max(a, b);
}
const int inf = 1e9 + 5;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n);
  for (int i = 0; i < int(n); i++) {
    cin >> a[i];
  }
  int ans = inf;
  for (int i = 0; i < int(n); i++) {
    int split = a[i];
    vector<int> cur, seg;
    for (int j = 0; j < int(n); j++) {
      if (a[j] < split) {
        int m = seg.size();
        sort(seg.begin(), seg.end());
        for (int p = 0; p < int(m - k + 1); p++) {
          cur.push_back(seg[p]);
        }
        seg.clear();
      } else {
        seg.push_back(a[j]);
      }
    }
    int m = seg.size();
    sort(seg.begin(), seg.end());
    for (int j = 0; j < int(m - k + 1); j++) {
      cur.push_back(seg[j]);
    }
    sort(cur.begin(), cur.end());
    while ((int)cur.size() < q) {
      cur.push_back(inf);
    }
    debug() << "[ "
            << "split"
               ": "
            << (split) << " ] "
            << "[ "
            << "cur"
               ": "
            << (cur) << " ] ";
    if (cur[0] == inf) continue;
    min_self(ans, cur[q - 1] - cur[0]);
  }
  cout << ans << endl;
}
