#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  int ret = 0, p = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') p = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') ret = ret * 10 + ch - '0', ch = getchar();
  return ret * p;
}
int n, k, Q;
int a[2000 + 3];
priority_queue<int, vector<int>, greater<int> > q;
int main() {
  n = read(), k = read(), Q = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  int ans = 1000000000 + 7;
  for (int i = 1; i <= n - k + 1; i++) {
    if (i + k + Q - 2 > n) break;
    while (!q.empty()) q.pop();
    for (int j = 1; j <= k; j++) q.push(a[i + j - 1]);
    int X = 0, Y = 1000000000 + 7;
    for (int j = 1; j <= Q; j++) {
      int t = q.top();
      q.pop();
      q.push(a[i + k - 1 + j]);
      X = max(X, t);
      Y = min(Y, t);
    }
    ans = min(ans, X - Y);
  }
  printf("%d\n", ans);
  return 0;
}
