#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n), sorted(n), ok(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sorted[i] = a[i];
  }
  sort(sorted.begin(), sorted.end());
  int ans = 1000000000;
  int left, right, mid, count;
  int c[4];
  bool flag = false;
  for (int i = 0; i < n - 1; i++) {
    flag = false;
    left = i;
    right = n - 1;
    count = 0;
    mid = right;
    c[0] = c[1] = c[2] = c[3] = 0;
    for (int j = 0; j < n; j++) {
      if (a[j] < sorted[i]) {
        ok[j] = 0;
      } else if (a[j] < sorted[mid] || a[j] > sorted[i]) {
        ok[j] = 1;
      } else if (a[j] == sorted[i]) {
        ok[j] = 2;
      } else {
        ok[j] = 3;
      }
    }
    for (int j = 0; j < k; j++) {
      c[ok[j]]++;
    }
    if (c[0] == 0 && c[1] > 0) count++;
    for (int j = k; j < n; j++) {
      c[ok[j]]++;
      c[ok[j - k]]--;
      if (c[0] == 0 && c[1] + c[2] > 0) {
        count++;
        if (c[2] > 0) flag = true;
      }
    }
    if (flag && count >= q) {
      right = mid;
    } else {
      break;
    }
    while (right - left > 1) {
      flag = false;
      count = 0;
      mid = (left + right) / 2;
      c[0] = c[1] = c[2] = c[3] = 0;
      for (int j = 0; j < n; j++) {
        if (a[j] < sorted[i]) {
          ok[j] = 0;
        } else if (a[j] < sorted[mid] || a[j] > sorted[i]) {
          ok[j] = 1;
        } else if (a[j] == sorted[i]) {
          ok[j] = 2;
        } else {
          ok[j] = 3;
        }
      }
      for (int j = 0; j < k; j++) {
        c[ok[j]]++;
      }
      if (c[0] == 0 && c[1] > 0) count++;
      for (int j = k; j < n; j++) {
        c[ok[j]]++;
        c[ok[j - k]]--;
        if (c[0] == 0 && c[1] + c[2] > 0) {
          count++;
          if (c[2] > 0) flag = true;
        }
      }
      if (flag && count >= q) {
        right = mid;
      } else {
        left = mid;
      }
    }
    if (right - left != 0) {
      ans = ((ans) < (sorted[right] - sorted[i]) ? (ans)
                                                 : (sorted[right] - sorted[i]));
    }
  }
  cout << ans << endl;
  return 0;
}
