#include <bits/stdc++.h>
using namespace std;
int n, k, q;
int a[2005], b[2005];
bool ok[2005];
priority_queue<int> pq;
vector<int> v;
int main() {
  scanf("%d%d%d", &n, &k, &q);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]), b[i] = a[i];
  sort(b + 1, b + n + 1);
  int Sol = b[n] - b[1];
  for (int t = 1; t <= n; ++t) {
    v.clear();
    memset(ok, 0, sizeof(ok));
    for (int i = 1; i <= n; ++i)
      if (a[i] >= b[t]) ok[i] = 1;
    int nr = 0, start = 0;
    for (int i = 1; i <= n; ++i) {
      if (ok[i] == 1) {
        if (nr == 0) start = i;
        ++nr;
        pq.push(-a[i]);
      } else {
        if (nr < k) {
          nr = 0;
          continue;
        }
        int w = nr - k + 1;
        while (w > 0) {
          int x = -pq.top();
          --w;
          pq.pop();
          v.push_back(x);
        }
        while (!pq.empty()) pq.pop();
      }
    }
    if (nr > k) {
      int w = nr - k + 1;
      while (w > 0) {
        int x = -pq.top();
        --w;
        pq.pop();
        v.push_back(x);
      }
      while (!pq.empty()) pq.pop();
    }
    if (v.size() < q) break;
    sort(v.begin(), v.end());
    Sol = min(Sol, v[q - 1] - b[t]);
  }
  printf("%d", Sol);
  return 0;
}
