#include <bits/stdc++.h>
using namespace std;
int a[2010];
int x[2010];
int mark[2010];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, K, Q;
  cin >> n >> K >> Q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    x[i] = a[i];
  }
  sort(x, x + n);
  int ans = 1e9;
  for (int i = 0; i < n; i++) {
    memset(mark, -1, sizeof(mark));
    for (int j = 0; j < n; j++) {
      if (a[j] < x[i]) {
        mark[max(0, j - (K - 1))] = j + (K - 1);
      }
    }
    int aux = -1;
    priority_queue<int> pq;
    for (int j = 0; j < n; j++) {
      aux = max(aux, mark[j]);
      if (aux < j) pq.push(-a[j]);
    }
    if (pq.size() < Q || -pq.top() != x[i]) {
      continue;
    }
    for (int j = 0; j < Q - 1; j++) pq.pop();
    ans = min(ans, -pq.top() - x[i]);
  }
  cout << ans << "\n";
  return 0;
}
