#include <bits/stdc++.h>
using namespace std;
long long N, M, K, re, C, CC;
long long A[200001];
bool f;
string S;
set<long long> sll;
vector<long long> vl;
vector<long long> vll;
int main() {
  cin >> N >> K >> M;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    sll.insert(A[i]);
  }
  re = 200000000000;
  for (auto x : sll) {
    vl.clear();
    vll.clear();
    C = 0;
    CC = 0;
    for (int i = 0; i < N; i++) {
      C++;
      if (A[i] < x) {
        if (C - 1 >= K) {
          for (int j = i - C + 1; j <= i; j++) {
            vll.push_back(A[j]);
          }
          CC += C - K;
          sort(vll.begin(), vll.end());
          for (int j = 0; j < C - K; j++) {
            vl.push_back(vll[j]);
          }
          vll.clear();
        }
        C = 0;
      } else if (i == N - 1) {
        if (C >= K) {
          for (int j = i - C + 1; j <= i; j++) {
            vll.push_back(A[j]);
          }
          CC += C - K + 1;
          sort(vll.begin(), vll.end());
          for (int j = 0; j < C - K + 1; j++) {
            vl.push_back(vll[j]);
          }
          vll.clear();
        }
        C = 0;
      }
    }
    if (CC >= M) {
      sort(vl.begin(), vl.end());
      if (CC >= M) {
        re = min(re, vl[M - 1] - vl[0]);
      }
    }
  }
  cout << re << endl;
  return 0;
}
