#include <bits/stdc++.h>
using namespace std;
const long long inf = (long long)1e9 + 10;
const long long linf = (long long)1e18 + 10;
const long long mod = (long long)(1e9 + 7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;
long long mop(long long a, long long b, long long m = mod) {
  long long r = 1;
  a %= m;
  for (; b; b >>= 1) {
    if (b & 1) r = r * a % m;
    a = a * a % m;
  }
  return r;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
bool ool(int x, int y, int h, int w) {
  return ((x < 0) || (h <= x) || (y < 0) || (w <= y));
}
bool deq(double a, double b) { return abs(a - b) < eps; }
struct oreno_initializer {
  oreno_initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
  }
} oreno_initializer;
int n, k, q, a[2020], res = inf;
int main() {
  cin >> n >> k >> q;
  for (int(i) = (0); (i) < (n); ++(i)) cin >> a[i];
  for (int(i) = (0); (i) < (n); ++(i)) {
    int y = a[i], b[2020] = {};
    for (int(j) = (0); (j) < (n); ++(j))
      if (a[j] < y) b[max(0, j - k + 1)]++, b[j + 1]--;
    for (int(j) = (0); (j) < (n); ++(j)) b[j + 1] += b[j];
    vector<int> mn;
    for (int(l) = (0); (l) < (n); ++(l))
      if (!b[l]) {
        int r = l;
        vector<int> t;
        while (r < n && !b[r]) t.push_back(a[r++]);
        sort((t).begin(), (t).end());
        for (int(j) = (0); (j) < ((int)t.size() - k + 1); ++(j))
          mn.push_back(t[j]);
        l = r - 1;
      }
    sort((mn).begin(), (mn).end());
    if (mn.size() >= q) res = min(res, mn[q - 1] - y);
  }
  cout << res;
}
