#include <bits/stdc++.h>
using namespace std;
const int N = 2005, INF = 1e9 + 5;
int a[N], b[N], c[N];
bool used[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k, q;
  cin >> n >> k >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int ans = INF;
  for (int h = 0; h < n; h++) {
    for (int i = 0; i < n; i++) {
      c[i] = (a[i] < a[h]);
    }
    int l = 0, r = INF;
    while (r - l > 1) {
      int p = (l + r) >> 1;
      for (int i = 0; i < n; i++) {
        b[i] = (a[i] <= p);
      }
      fill(used, used + n, 0);
      int z = 0, cq = 0, y = 0, ct = k;
      for (int i = 0, j = k - 1; j < n; j++, ct++) {
        while (ct > k) {
          ct -= !used[i];
          i++;
        }
        y = max(i, y);
        z = max(z, i);
        while (y < n && c[y] == 0) y++;
        if (y <= j) continue;
        while (true) {
          while (z < n && b[z] == 0) z++;
          if (z > j) break;
          used[z] = true;
          j++;
          cq++;
          z++;
          if (j >= n) break;
        }
      }
      if (cq >= q) {
        r = p;
      } else {
        l = p;
      }
    }
    if (r != INF) {
      ans = min(ans, r - a[h]);
    }
  }
  cout << ans;
  return 0;
}
