#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
int a[N], b[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k, q;
  cin >> n >> k >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int l = 0, r = 1e9 + 5;
  while (r - l > 1) {
    int p = (l + r) >> 1;
    for (int i = 0; i < n; i++) {
      b[i] = (a[i] <= p);
    }
    int z = 0, cq = 0;
    for (int i = 0, j = i + k - 1; j < n; i++, j++) {
      while (true) {
        while (z < n && b[z] == 0) z++;
        if (z > j) break;
        j++;
        cq++;
        z++;
        if (j >= n) break;
      }
    }
    if (cq >= q) {
      r = p;
    } else {
      l = p;
    }
  }
  cout << r - *min_element(a, a + n);
  return 0;
}
