#include <bits/stdc++.h>
using namespace std;
long long int A[10001], B[10001];
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  long long int x, y, z, i, j, n, k, q, a, b, ans = 1e18;
  cin >> n >> k >> q;
  for (i = 1; i <= n; ++i) {
    cin >> A[i];
    B[i] = A[i];
  }
  sort(B + 1, B + n + 1);
  for (i = 1; i + q - 1 <= n; ++i) {
    long long int tmp = B[i + q - 1] - B[i];
    x = B[i];
    long long int cur = 0;
    long long int moves = 0;
    for (j = 1; j <= n; ++j) {
      if (A[j] >= x)
        cur += 1;
      else {
        if (cur >= k) moves = moves + cur - k + 1;
        cur = 0;
      }
    }
    if (cur >= k) moves = moves + cur - k + 1;
    if (moves < q) break;
    ans = min(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}
