#include <bits/stdc++.h>
using namespace std;
constexpr double PI = 3.1415926535897932;
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  int ans = INF;
  for (int i = 0; i < n; ++i) {
    vector<int> pos;
    pos.push_back(0);
    for (int j = 0; j < n; ++j) {
      if (a[j] < a[i]) pos.push_back(j);
    }
    pos.push_back(n);
    int sz = pos.size();
    vector<int> val;
    for (int j = 0; j + 1 < sz; ++j) {
      vector<int> foo;
      int left = pos[j], right = pos[j + 1];
      for (int x = left; x < right; ++x) {
        foo.push_back(a[x]);
      }
      sort(foo.begin(), foo.end(), greater<int>());
      int sz2 = foo.size();
      for (int x = k - 1; x < sz2; ++x) {
        val.push_back(foo[x]);
      }
    }
    if (val.size() < q) continue;
    sort(val.begin(), val.end());
    ans = min(ans, val[q - 1] - val[0]);
  }
  cout << ans << endl;
}
