#include <bits/stdc++.h>
using namespace std;
int dirs[4][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
int inf = 1e9;
int n, k, q;
vector<int> v;
bool can(int interval_left, int interval_right) {
  int tot = 0;
  vector<bool> available(n, true);
  int ptr1 = k - 1;
  int ptr2 = 0;
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      pq;
  for (int i = 0; i < k; i++) pq.push(make_pair(v[i], i));
  while (true) {
    if (ptr1 >= n) break;
    pair<int, int> p = pq.top();
    int val = p.first;
    int idx = p.second;
    if (!(ptr2 <= idx && idx <= ptr1)) {
      pq.pop();
      continue;
    }
    if (interval_left <= val && val <= interval_right) {
      available[idx] = false;
      pq.pop();
      tot++;
      ptr1++;
      if (ptr1 >= n) break;
      pq.push(make_pair(v[ptr1], ptr1));
    } else {
      ptr2++;
      while (ptr2 < n && !available[ptr2]) ptr2++;
      ptr1++;
      if (ptr1 >= n) break;
      pq.push(make_pair(v[ptr1], ptr1));
    }
  }
  return tot >= q;
}
int main() {
  scanf("%d %d %d", &n, &k, &q);
  v.assign(n, -1);
  for (int i = 0; i < n; i++) scanf("%d", &v[i]);
  int ans = inf + 5;
  vector<int> sorted(n);
  for (int i = 0; i < n; i++) {
    sorted[i] = v[i];
  }
  sort(sorted.begin(), sorted.end());
  ans = sorted[q - 1] - sorted[0];
  int ptr1 = q - 1;
  int ptr2 = 0;
  while (ptr1 + 1 < n) {
    ptr1++;
    while (ptr1 - ptr2 + 1 >= q && can(sorted[ptr2], sorted[ptr1])) ptr2++;
    ptr2--;
    ans = min(ans, sorted[ptr1] - sorted[ptr2]);
  }
  printf("%d\n", ans);
  return 0;
}
