#include <bits/stdc++.h>
using namespace std;
const int maxN = 2018;
int n, k, q, i, j, ans;
int a[maxN];
vector<int> v, glob, loc;
void execute() {
  if (loc.size() < k) return;
  nth_element(loc.begin(), loc.begin() + (loc.size() - k), loc.end());
  loc.resize(loc.size() - k + 1);
  for (auto e : loc) glob.push_back(e);
  loc.clear();
}
int main() {
  scanf("%d%d%d", &n, &k, &q);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    v.push_back(a[i]);
  }
  sort(v.begin(), v.end());
  v.resize(unique(v.begin(), v.end()) - v.begin());
  ans = 1 << 30;
  for (auto base : v) {
    glob.clear();
    loc.clear();
    for (i = 1; i <= n; i++) {
      if (a[i] < base) {
        execute();
      } else {
        loc.push_back(a[i]);
      }
    }
    execute();
    if (glob.size() < q) continue;
    nth_element(glob.begin(), glob.begin() + q - 1, glob.end());
    glob.resize(q);
    int maxi = glob[0];
    for (auto e : glob) maxi = max(maxi, e);
    ans = min(ans, maxi - base);
  }
  printf("%d", ans);
  return 0;
}
