#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
const double EPS = 1e-9;
const long long INF = 10e10;
double equal(double a, double b) { return fabs(a - b) < DBL_EPSILON; }
std::istream &operator>>(std::istream &in, set<string> &o) {
  string a;
  in >> a;
  o.insert(a);
  return in;
}
std::istream &operator>>(std::istream &in, queue<int> &o) {
  long long a;
  in >> a;
  o.push(a);
  return in;
}
long long solve(vector<long long> &numbers, int n, int k, int q,
                long long target) {
  vector<vector<long long>> tmp(1);
  for (long long l : numbers) {
    if (l < target)
      tmp.push_back({});
    else
      tmp.back().push_back(l);
  }
  vector<long long> candidate;
  for (vector<long long> &v : tmp) {
    if (v.size() < k) continue;
    sort(v.begin(), v.end());
    int c = v.size() - k + 1;
    for (int i = 0; i < (c); ++i) candidate.push_back(v[i]);
  }
  if (candidate.size() < q) return INF;
  return candidate[q - 1] - target;
}
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<long long> numbers(n);
  for (int i = 0; i < (n); ++i) cin >> numbers[i];
  long long ans = INF;
  for (int i = 0; i < (n); ++i)
    ans = min(ans, solve(numbers, n, k, q, numbers[i]));
  cout << ans << endl;
}
