#include <bits/stdc++.h>
using namespace std;
struct Grid {
  long long x, y, t;
};
struct Edge {
  long long to, cost;
};
struct Graph {
  vector<vector<Edge>> E;
  int V;
  const long long Inf = 1e18;
  const int MAX_V = 201010;
  vector<long long> d;
  Graph(int n) : E(n) {
    d.resize(MAX_V);
    E.resize(n);
    V = n;
  }
  void init() {
    for (int i = 0; i < MAX_V; i++) d[i] = Inf;
  }
  void add_edge(long long from, long long to, long long cost) {
    E[from].push_back({to, cost});
  }
};
map<long long, long long> zip;
map<long long, long long> unzip;
vector<vector<long long>> posi(2100);
void make_zip(vector<long long> A) {
  sort((A).begin(), (A).end());
  long long now = 1;
  zip[A[0]] = now;
  unzip[now] = A[0];
  for (int i = 1; i < A.size(); i++) {
    if (A[i] != A[i - 1]) now++;
    zip[A[i]] = now;
    unzip[now] = A[i];
  }
}
bool vis[2500] = {};
long long nxt[2500] = {};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, k, q;
  cin >> n >> k >> q;
  vector<long long> A(n);
  vector<long long> B(n);
  for (auto &a : A) {
    cin >> a;
  }
  make_zip(A);
  for (int i = 0; i < n; i++) {
    B.push_back(A[i]);
    posi[zip[A[i]]].push_back(i);
  }
  sort((B).begin(), (B).end());
  long long ans = 1e18;
  long long po = 0;
  set<long long> se;
  long long cnt = 0;
  for (int i = 1; i < 2000; i++) {
    bool fl = true;
    while (i > zip[B[po]]) {
      for (auto a : posi[zip[B[po]]]) {
        for (int j = a - k + 1; j <= a + k - 1; j++) {
          if (nxt[j]) {
            j = nxt[j];
            continue;
          }
          nxt[j] = a + k - 1;
          vis[j] = true;
          cnt++;
        }
      }
      po++;
    }
    if (n - cnt >= q) {
      while (i > zip[B[po]]) po++;
      ans = min(ans, B[po + q - 1] - B[po]);
    } else
      break;
  }
  cout << ans << endl;
  return 0;
}
