#include <bits/stdc++.h>
using namespace std;
const int dx44[5] = {0, -1, -1, 1, 1};
const int dy44[5] = {0, -1, 1, -1, 1};
const int dx4[5] = {0, -1, 0, 1, 0};
const int dy4[5] = {0, 0, 1, 0, -1};
const int dx8[9] = {0, -1, 0, 1, 0, 1, 1, -1, -1};
const int dy8[9] = {0, 0, 1, 0, -1, 1, -1, 1, -1};
const int dx82[9] = {0, -1, -1, 1, 1, 2, 2, -2, -2};
const int dy82[9] = {0, 2, -2, 2, -2, 1, -1, 1, -1};
const int maxn = 2e3 + 50;
const double PI = acos(-1.0);
const long long mod = 1e9 + 7;
long long po(long long a, long long b, long long mod) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) {
  if (a == 0) {
    return b;
  } else {
    return gcd(b % a, a);
  }
}
void extgcd(long long a, long long b, long long& d, long long& x,
            long long& y) {
  if (!b) {
    d = a;
    x = 1;
    y = 0;
  } else {
    extgcd(b, a % b, d, y, x);
    y -= x * (a / b);
  }
}
long long inverse(long long a, long long n) {
  long long d, x, y;
  extgcd(a, n, d, x, y);
  return d == 1 ? (x + n) % n : -1;
}
void YES() {
  puts("YES");
  exit(0);
}
void Yes() { puts("Yes"); }
void NO() {
  puts("NO");
  exit(0);
}
void No() { puts("No"); }
void one() {
  puts("-1");
  exit(0);
}
long long n, k, q;
long long ans;
long long val[maxn];
long long vis[maxn];
long long c[maxn];
void cal(long long x, int f) {
  for (int i = 1; i <= n; i++) {
    if (val[i] < x) {
      vis[i] = 0;
    } else {
      vis[i] = 1;
    }
  }
  int len = 0;
  vector<int> v;
  memset(c, 0, sizeof(c));
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    if (vis[i] && i != f) {
      len++;
      if (len >= k) {
        c[i - k + 1]++;
        flag = 1;
      }
    } else {
      if (flag) {
        c[i]--;
        flag = 0;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    c[i] += c[i - 1];
  }
  for (int i = 1; i <= n; i++) {
    cout << "c[i]"
         << ": " << c[i] << endl;
    if (c[i] > 0) {
      v.push_back(val[i]);
    }
  }
  sort(v.begin(), v.end());
  if (v.size() < q) return;
  cout << "ans"
       << ": " << ans << endl;
  cout << "x"
       << ": " << x << endl;
  ans = min(ans, v[v.size() - q] - x);
  cout << "ans"
       << ": " << ans << endl;
  if (ans == 2) {
    printf("here");
    cout << "f"
         << ": " << f << endl;
  }
}
void solve() {
  scanf("%lld%lld%lld", &n, &k, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &val[i]);
  }
  ans = INT_MAX;
  for (int i = 1; i <= n; i++) {
    cal(val[i], i);
  }
  printf("%lld\n", ans);
}
int main() {
  int t;
  t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
