#include <bits/stdc++.h>
using namespace std;
int a[2010], b[2010], n, k, Q, ans = 1e9, c[2010], tot;
bool vis[2010];
priority_queue<int, vector<int>, greater<int> > q;
void solve(int w) {
  tot = 0;
  for (int i = 1; i <= n; i++)
    if (b[i] < w) vis[i] = 1;
  for (int i = 1; i <= n; i++) {
    if (vis[i] == 1) {
      while (q.size() >= k) c[++tot] = q.top(), q.pop();
      while (!q.empty()) q.pop();
    }
    q.push(b[i]);
  }
  while (q.size() >= k) c[++tot] = q.top(), q.pop();
  while (!q.empty()) q.pop();
  sort(c + 1, c + 1 + tot);
  ans = min(ans, c[Q] - c[1]);
}
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(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) solve(a[i]);
  printf("%d", ans);
}
