#include <bits/stdc++.h>
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
using ll = long long;
using ull = unsigned long long;
using namespace std;
const int INF = 1 << 30;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  vector<int> b = a, c;
  sort(b.begin(), b.end());
  int ans = INF;
  for (int i = 0; i < (n); i++) {
    int count = 1 - k, num = 0;
    for (int j = 0; j < (n); j++) {
      if (b[i] <= a[j])
        count++;
      else {
        a[j] = INF;
        num += max(0, count);
        count = 1 - k;
      }
    }
    num += max(0, count);
    if (num < q) break;
    c = a;
    sort(c.begin(), c.end());
    if (c[q - 1] == INF)
      break;
    else
      chmin(ans, c[q - 1] - b[i]);
  }
  cout << ans << endl;
}
