#include <bits/stdc++.h>
using namespace std;
long long power(long long b, long long e) {
  long long sol = 1;
  while (e > 0) {
    if (e & 1) {
      sol = sol * b;
    }
    e >>= 1;
    b *= b;
  }
  return sol;
}
void quickSort(int l, int r, int* a, int* b) {
  if (l >= r) return;
  int piv = a[r];
  int i = l - 1;
  for (int j = l; j < r; j++) {
    if (a[j] <= piv) {
      i++;
      swap(a[i], a[j]);
      swap(b[i], b[j]);
    }
  }
  swap(a[i + 1], a[r]);
  swap(b[i + 1], b[r]);
  quickSort(l, i, a, b);
  quickSort(i + 2, r, a, b);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, K, Q;
  int a[2000];
  int order[2000];
  int xxx[2000];
  cin >> N >> K >> Q;
  for (int i = (0); i <= (N - 1); ++i) {
    cin >> a[i];
    xxx[i] = a[i];
    order[i] = i;
  }
  quickSort(0, N - 1, xxx, order);
  int ans = 1 << 30;
  for (int minX = (0); minX <= (N - 1); ++minX) {
    vector<int> split;
    for (int i = (0); i <= (N - 1); ++i) {
      if (a[i] < a[order[minX]]) {
        split.push_back(i);
      }
    }
    split.push_back(N);
    vector<int> seqMin;
    int spSz = int((split).size());
    int left = 0;
    for (int i = (0); i <= (spSz - 1); ++i) {
      vector<int> part;
      for (int j = (left); j <= (split[i] - 1); ++j) {
        part.push_back(a[j]);
      }
      sort((part).begin(), (part).end());
      for (int j = (0); j <= (split[i] - left - K + 1 - 1); ++j) {
        seqMin.push_back(part[j]);
      }
      left = split[i] + 1;
    }
    if (int((seqMin).size()) >= Q) {
      ans = min(ans, seqMin[Q - 1] - seqMin[0]);
    }
  }
  cout << ans << endl;
}
