#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f2f1f0f;
const long long LINF = 1ll * INF * INF;
const int MAX_N = 2e3 + 10;
int N, K, Q;
int Ix[MAX_N], Cnt[MAX_N];
bool Vis[MAX_N];
vector<pair<int, int> > Co;
int main() {
  cin >> N >> K >> Q;
  for (int i = 0; i < N; i++) {
    int x;
    scanf("%d", &x);
    Co.emplace_back(x, i);
  }
  sort((Co).begin(), (Co).end());
  int ans = INF;
  for (int s = 0, e = 0; s < N; s = e) {
    int ix = 0, cnt = 0;
    for (int a = 0, b = 0; a < N; a = b) {
      if (Vis[a]) {
        b = a + 1;
        continue;
      }
      ix++;
      int cnt = 0;
      while (b < N && !Vis[b]) {
        Ix[b] = ix;
        cnt++;
        b++;
      }
      Cnt[ix] = max(0, cnt - K + 1);
    }
    int now = 0;
    for (int i = s; i < N; i++) {
      if (--Cnt[Ix[i]] >= 0) now++;
      if (now == Q) {
        ans = min(ans, Co[i].first - Co[s].first);
        break;
      }
    }
    while (e < N && Co[s].first == Co[e].first) {
      int x, ix;
      tie(x, ix) = Co[e];
      Vis[ix] = true;
      e++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
