#include <bits/stdc++.h>
#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;
int IT_MAX = 1 << 19;
const long long MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1);
const double ERR = 1e-10;
const int MX = 200005;
int A[MX], B[MX];
int chk[MX];
int N, K, Q;
int main() {
  scanf("%d%d%d", &N, &K, &Q);
  for (int i = 1; i <= N; i++) scanf("%d", A + i);
  for (int i = 1; i <= N; i++) B[i] = i;
  sort(B + 1, B + N + 1, [](int l, int r) { return A[l] < A[r]; });
  chk[N + 1] = 1;
  int ans = 1e9;
  for (int i = 1; i <= N; i++) {
    vector<int> L, M;
    for (int i = 1; i <= N + 1; i++) {
      if (chk[i]) {
        sort(L.begin(), L.end());
        for (int t = 0; t < (int)L.size() - K + 1; t++) M.push_back(L[t]);
        L.clear();
      } else
        L.push_back(A[i]);
    }
    if (M.size() >= Q) ans = min(ans, M[Q - 1] - M[0]);
    chk[B[i]] = 1;
  }
  printf("%d\n", ans);
}
