#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
int n, k, q, arr[2000];
pair<int, int> a[2000];
int get(int val) {
  int cnt = 0, mx = 0;
  for (int t = 0; t < n; t++)
    if (a[t].first >= val) {
      int i = a[t].second, c = 0;
      for (int j = i - 1; j >= 0 && arr[j] >= val; j--) {
        if (arr[j] > arr[i]) c++;
      }
      for (int j = i + 1; j < n && arr[j] >= val; j++) {
        if (arr[j] >= arr[i]) c++;
      }
      if (c + 1 >= k) {
        mx = arr[i];
        cnt++;
      }
      if (cnt >= q) return mx - val;
    }
  return inf;
}
int main() {
  scanf("%d%d%d", &n, &k, &q);
  for (int i = 0; i < n; i++) {
    scanf("%d", arr + i);
    a[i].first = arr[i];
    a[i].second = i;
  }
  sort(a, a + n);
  int ans = inf;
  for (int i = 0; i < n; i++)
    if (i == 0 || a[i].first != a[i - 1].first) ans = min(ans, get(a[i].first));
  printf("%d\n", ans);
  return 0;
}
