#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
long long mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
long long llmax = 9223372036854775807;
long long llmin = -9223372036854775807;
vector<int> del[3000];
int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  int A[N];
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  int ans = intmax;
  for (int i = 0; i < N; i++) {
    int minnum = A[i];
    vector<int> now;
    for (int j = 0; j < N; j++) {
      if (A[j] >= minnum) {
        now.push_back(A[j]);
      } else {
        sort(now.begin(), now.end());
        int m = now.size();
        for (int k = 0; k < m - K + 1; k++) {
          del[i].push_back(now[k]);
        }
        now.clear();
      }
    }
    sort(now.begin(), now.end());
    int m = now.size();
    for (int k = 0; k < m - K + 1; k++) {
      del[i].push_back(now[k]);
    }
    int p = del[i].size();
    if (p >= Q) {
      ans = min(ans, del[i][Q - 1] - minnum);
    }
  }
  cout << ans << endl;
}
