#include <bits/stdc++.h>
using namespace std;
long long n, k, q;
long long a[2005];
long long b[2005];
long long dame;
long long start[2005];
long long sta;
long long owa;
long long owari[2005];
long long flag;
long long kaisu;
long long X, Y;
long long ans;
int main() {
  cin >> n >> k >> q;
  for (long long i = (0); (i) < (n); (i)++) cin >> a[i];
  for (long long i = (0); (i) < (n); (i)++) b[i] = a[i];
  sort(b, b + n);
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  ans = 10000000000000;
  for (long long now = (0); (now) < (n); (now)++) {
    priority_queue<long long, vector<long long>, greater<long long> > que;
    dame = b[now] - 1;
    sta = 0;
    flag = 0;
    for (long long i = (0); (i) < (n); (i)++) {
      if (flag == 0) {
        if (a[i] > dame) {
          flag = 1;
          start[sta] = i;
          if (i == n - 1) {
            owari[sta] = i;
            sta++;
          }
        }
      } else {
        if (a[i] <= dame) {
          flag = 0;
          owari[sta] = i - 1;
          sta++;
        } else if (i == n - 1) {
          owari[sta] = i;
          sta++;
        }
      }
    }
    for (long long i = (0); (i) < (sta); (i)++) {
      priority_queue<long long, vector<long long>, greater<long long> > subque;
      for (long long j = (start[i]); (j) < (owari[i] + 1); (j)++) {
        subque.push(a[j]);
      }
      kaisu = (owari[i] - start[i] + 1) - k + 1;
      for (long long j = (0); (j) < (kaisu); (j)++) {
        que.push(subque.top());
        subque.pop();
      }
    }
    for (long long i = (0); (i) < (q); (i)++) {
      if (que.empty()) break;
      if (i == 0) {
        X = que.top();
        que.pop();
      } else if (i == q - 1) {
        Y = que.top();
        if (ans > Y - X) ans = Y - X;
      } else
        que.pop();
    }
  }
  cout << ans << endl;
  return 0;
}
