#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[20000];
  int b[20000];
  int m[20000];
  vector<int> s;
  vector<pair<pair<int, int>, int> > ss;
  int c[20000];
  int d[20000];
  int n, k, q;
  int x, sum, ans;
  scanf("%d %d %d", &n, &k, &q);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i <= (n - k); i++) {
    m[i] = 1000000007;
    for (int j = 0; j < k; j++) {
      if (m[i] > a[i + j]) m[i] = a[i + j];
    }
  }
  for (int i = 0; i < n; i++) {
    b[i] = -1;
    for (int j = 0; j < k; j++) {
      if ((i + j) >= (k - 1) && (i + j) <= (n + 1)) {
        if (m[(i + j - k + 1)] > b[i]) b[i] = m[(i + j - k + 1)];
      }
    }
    s.push_back(b[i]);
    ss.push_back(make_pair(make_pair(a[i], -b[i]), i));
  }
  sort(ss.begin(), ss.end(), greater<pair<pair<int, int>, int> >());
  sort(s.begin(), s.end(), greater<int>());
  c[0] = 1;
  d[0] = s[0];
  x = 0;
  for (int i = 0; i < (int)((n - 1)); i++) {
    if (d[x] = s[i + 1])
      c[x]++;
    else {
      x++;
      c[x] = 1;
      d[x] = s[i + 1];
    }
  }
  ans = 1000000007;
  for (int i = 0; i < (int)(n - q + 1); i++) {
    sum = 0;
    for (int j = 0; j < (int)(x + 1); j++) {
      sum += c[j];
      if (sum >= q) {
        if ((ss[i].first.first - d[j]) < ans) ans = (ss[i].first.first - d[j]);
        break;
      }
    }
    for (int j = 0; j < (int)(x + 1); j++) {
      if (d[j] + ss[i].first.second == 0) c[j]--;
    }
  }
  if (ans == 1000000007) ans = 0;
  printf("%d\n", ans);
  return 0;
}
