#include <bits/stdc++.h>
int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }
typedef struct node {
  int v;
  int index;
} node;
int cmpNode(const void *a, const void *b) {
  return ((node *)a)->v - ((node *)b)->v;
}
void run(void) {
  int n, k, q;
  scanf("%d%d%d", &n, &k, &q);
  int *a = (int *)calloc(n, sizeof(int));
  int i;
  for (i = 0; i < n; i++) scanf("%d", a + i);
  node *b = (node *)calloc(n, sizeof(node));
  for (i = 0; i < n; i++) b[i] = (node){a[i], i};
  qsort(b, n, sizeof(node), cmpNode);
  int *tmp = (int *)calloc(n, sizeof(int));
  int *pop = (int *)calloc(n, sizeof(int));
  int ans = b[q - 1].v - b[0].v;
  for (i = 0; i < n - q; i++) {
    a[b[i].index] = -1;
    int popLen = 0;
    int j = 0;
    while (j < n) {
      int k = j;
      int len = 0;
      while (k < n && a[k] != -1) tmp[len++] = a[k++];
      qsort(tmp, len, sizeof(int), cmp);
      while (len >= k) {
        pop[popLen++] = tmp[--len];
      }
      j = k + 1;
    }
    if (popLen < q) break;
    qsort(pop, popLen, sizeof(int), cmp);
    int t = pop[q - 1] - pop[0];
    if (t < ans) ans = t;
  }
  printf("%d\n", ans);
}
int main(void) {
  run();
  return 0;
}
