#include <bits/stdc++.h>
using namespace std;
namespace Header_Template {
template <class T>
inline void read(T &x) {
  x = 0;
  T tmp = 1;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') tmp = -1, c = getchar();
  while (c >= '0' && c <= '9') x = (x << 1) + (x << 3) + c - '0', c = getchar();
  x *= tmp;
}
template <class T>
inline void Max(T &x, T y) {
  if (y > x) x = y;
}
template <class T>
inline void Min(T &x, T y) {
  if (y < x) x = y;
}
}  // namespace Header_Template
using namespace Header_Template;
const int N = 2010, M = 12;
int n, k, q, a[N];
multiset<int> s;
int main(void) {
  read(n), read(k), read(q);
  for (int i = 1; i <= n; ++i) read(a[i]);
  int ans = 1e9;
  for (int j = 1; j <= n; ++j) {
    int val = a[j];
    for (int l = 1, r; l <= n;) {
      if (a[l] < val) {
        ++l;
        continue;
      }
      r = l + q + k - 1;
      if (r - 1 > n) break;
      s.clear();
      for (int i = l; i < r && i <= n; ++i) s.insert(a[i]);
      while (r <= n && a[r] >= val) s.insert(a[r]), ++r;
      while (l < r && a[l] < val) s.erase(s.find(a[l])), ++l;
      if (r - l < q + k - 1) {
        l = r + 1;
        continue;
      }
      int low = *s.begin();
      for (int i = 1; i < q; ++i) s.erase(s.begin());
      int high = *s.begin();
      Min(ans, high - low);
      l = r + 1;
    }
  }
  printf("%d\n", ans);
  return 0;
}
