#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using G = vector<vector<int>>;
int di[] = {0, -1, 0, 1};
int dj[] = {1, 0, -1, 0};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n), b;
  for (int i = (0); i < (n); i++) {
    cin >> a[i];
    b.push_back(a[i]);
  }
  a.push_back(0);
  b.push_back(0);
  sort(b.begin(), b.end());
  int ans = 1e9;
  for (int i = (0); i < (n + 1); i++) {
    vector<int> u, v;
    for (int j = (0); j < (n + 1); j++) {
      if (a[j] <= b[i]) {
        int m = u.size();
        if (m < k) continue;
        sort(u.begin(), u.end());
        for (int l = (0); l < (m - k + 1); l++) {
          v.push_back(u[l]);
        }
        u.clear();
      } else {
        u.push_back(a[j]);
      }
    }
    int m = v.size();
    sort(v.begin(), v.end());
    if (m < q) continue;
    ans = min(ans, v[q - 1] - v[0]);
  }
  cout << ans << endl;
  return 0;
}
