#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
inline int read() {
  int x = 0, w = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') w = -1;
    c = getchar();
  }
  while (c <= '9' && c >= '0') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  return w == 1 ? x : -x;
}
int n, k, Q, a[1000005], p[1000005], c[1000005], d[1000005], c2, q[1000005], c3,
    ans;
inline void wk(int x) {
  for (int i = 1; i <= n; i++)
    if (a[i] >= a[x]) p[i] = 1;
  c2 = 0;
  c3 = 0;
  for (int i = 1; i <= n; i++) {
    int cnt = 0;
    while (p[i] == 1) cnt++, d[++c2] = a[i], i++;
    sort(d + 1, d + c2 + 1);
    for (int j = 1; j <= (cnt - k + 1); j++) q[++c3] = d[j];
  }
  sort(q + 1, q + c3 + 1);
  if (q[Q]) ans = min(ans, q[Q] - a[x]);
  for (int i = 1; i <= c3; i++) q[i] = 0;
  for (int i = 1; i <= n; i++) p[i] = 0;
}
int main() {
  n = read();
  k = read();
  Q = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  ans = 1e9;
  for (int i = 1; i <= n; i++) wk(i);
  cout << ans << endl;
  return 0;
}
