#include <bits/stdc++.h>
using namespace std;
int n, k, q, a[2005];
int l[2005], r[2005], ans = 2e9;
void solve(int ind) {
  int cl = 0, cr = 0;
  for (int i = 1; i < ind; ++i) l[++cl] = a[i];
  for (int i = ind + 1; i <= n; ++i) r[++cr] = a[i];
  if (max(0, cl - k + 1) + max(0, cr - k + 1) < q) return;
  sort(l + 1, l + cl + 1);
  sort(r + 1, r + 1 + cr);
  int _1 = 0, _2 = 0, _3 = 0, _4 = 0, mx = 0, mi = 2e9;
  if (cl >= k) _1 = l[1], _2 = l[cl - k + 1];
  if (cr >= k) _3 = r[1], _4 = r[cr - k + 1];
  if (_1) mx = max(mx, _1), mi = min(mi, _1);
  if (_2) mx = max(mx, _2), mi = min(mi, _2);
  if (_3) mx = max(mx, _3), mi = min(mi, _3);
  if (_4) mx = max(mx, _4), mi = min(mi, _4);
  ans = min(ans, mx - mi);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k >> q;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i) solve(i);
  sort(a + 1, a + 1 + n);
  ans = min(ans, a[q] - a[1]);
  cout << ans << endl;
  return 0;
}
