#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
template <class T, class U>
void init_n(vector<T>& v, size_t n, U x) {
  v = vector<T>(n, x);
}
template <class T>
void init_n(vector<T>& v, size_t n) {
  init_n(v, n, T());
}
template <class T>
void read_n(vector<T>& v, size_t n) {
  v = vector<T>(n);
  for (lli i = 0; i < n; ++i) cin >> v[i];
}
template <class T, class U>
void read_n(vector<pair<T, U>>& v, size_t n) {
  v = vector<pair<T, U>>(n);
  for (lli i = 0; i < n; ++i) cin >> v[i].first >> v[i].second;
}
template <class T>
T gabs(const T& x) {
  return max(x, -x);
}
lli n, k, q;
vector<lli> a;
int main() {
  cin >> n >> k >> q;
  read_n(a, n);
  lli min_pos = 0;
  for (lli i = 1; i < n; ++i) {
    if (a[i] < a[min_pos]) min_pos = i;
  }
  lli min_v = a[min_pos];
  a.erase(begin(a) + min_pos);
  q--;
  lli w = k + q - 1;
  lli max_v = 1e10;
  vector<lli> span(w);
  for (lli i = 0; i < n - w + 1; ++i) {
    copy(begin(a) + i, begin(a) + i + w, begin(span));
    nth_element(begin(span), begin(span) + q - 1, end(span));
    lli x = *(begin(span) + q - 1);
    max_v = min(max_v, x);
  }
  cout << max_v - min_v << endl;
  return 0;
}
