#include <bits/stdc++.h>
int compare_int(const void *a, const void *b) { return *(int *)a - *(int *)b; }
int main(void) {
  int n, m, q;
  int a[2050];
  int b[2050];
  int c[2050];
  int l, r;
  int i, j, k;
  int flag = 0;
  int ans = 0;
  int count = 0;
  long long int temp, temp1, temp2;
  int max, min;
  int len;
  int sum = 0;
  scanf("%d %d %d", &n, &m, &q);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  ans = 1500000000;
  for (i = 0; i < n; i++) {
    temp = a[i];
    l = -1;
    r = -1;
    count = 0;
    for (j = 0; j <= n; j++) {
      if (a[j] < temp || j == n) {
        l = r;
        r = j;
        for (k = 1; k < r - l; k++) {
          b[k - 1] = a[l + k];
        }
        qsort(b, r - l - 1, sizeof(int), compare_int);
        for (k = 0; k < r - l - m; k++) {
          c[count] = b[count];
          count++;
        }
      }
    }
    if (count >= q) {
      qsort(c, count, sizeof(int), compare_int);
      temp = c[q - 1] - c[0];
      ans = ((ans) < (temp) ? (ans) : (temp));
    }
  }
  printf("%d", ans);
  return 0;
}
