#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e4;
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll INF = 1 << 30;
const ll INF2 = 9e18;
const double INF3 = 9e14;
const double eps = 1e-10;
const double PI = 3.14159265358979323846;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const int tx[8] = {-1, 0, 1, -1, 1, -1, 0, 1},
          ty[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
ll n, k, q, a[2010], ans = INF2;
ll div(ll mini) {
  vector<ll> v, now;
  int cnt = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] >= mini) {
      now.emplace_back(a[i]);
      cnt++;
    }
    if (i == n - 1 && cnt >= k) {
      if (now.size() == 0) continue;
      sort((now).begin(), (now).end());
      for (int j = 0; j < cnt - k; j++) v.emplace_back(now[j]);
      now.clear();
    } else if (cnt < k && a[i] < mini) {
      cnt = 1;
      now.clear();
    } else if (cnt >= k && a[i] < mini) {
      cnt = 1;
      if (now.size() == 0) continue;
      sort((now).begin(), (now).end());
      for (int j = 0; j < cnt - k; j++) v.emplace_back(now[j]);
      now.clear();
    }
  }
  sort((v).begin(), (v).end());
  if (v.size() < q) return INF2;
  return v[q - 1];
}
int main() {
  cin >> n >> k >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    ans = min(ans, div(a[i]) - a[i]);
  }
  cout << ans << endl;
  return 0;
}
