#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 10;
int a[N], b[N], n, k, q;
bool flag[N];
int main() {
  scanf("%d%d%d", &n, &k, &q);
  set<int> s;
  for (int i = 0; i < n; i++) scanf("%d", &a[i]), s.insert(a[i]), b[i] = a[i];
  sort(b, b + n);
  int ans = 2e9;
  for (auto lm : s) {
    for (int i = 0; i < n; i++)
      if (a[i] < lm)
        flag[i] = false;
      else
        flag[i] = true;
    int tot = 0;
    for (int i = 0, j; i < n; i = j) {
      for (j = i + 1; flag[i] && flag[j] && j < n; j++)
        ;
      if (!flag[i]) continue;
      tot += max(0, j - i - k + 1);
    }
    if (tot < q) break;
    int t = 0;
    while (b[t] < lm) t++;
    ans = min(ans, b[t + q - 1] - b[t]);
  }
  printf("%d\n", ans);
  return 0;
}
