#include <bits/stdc++.h>
using namespace std;
long long n, m, k, a[2000], ans = 1000000000;
vector<long long> u, v;
int main(void) {
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    v = {};
    u = {};
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      if (a[i] <= a[j]) {
        v.push_back(a[j]);
      } else {
        if (v.size() >= m) {
          sort(v.begin(), v.end());
          for (int i = 0; i < min((long long)v.size() - m + 1LL, k - 1LL); i++)
            u.push_back(v[i]);
        }
        v = {};
      }
    }
    if (v.size() >= m) {
      sort(v.begin(), v.end());
      for (int i = 0; i < min((long long)v.size() - m + 1, k - 1); i++)
        u.push_back(v[i]);
    }
    if (u.size() < k - 1) continue;
    sort(u.begin(), u.end());
    ans = min(ans, u[k - 2] - a[i]);
  }
  cout << ans << endl;
}
