#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
constexpr double EPS = 1e-9;
constexpr double PI = 3.1415926535897932;
constexpr int INF = 2147483647;
constexpr long long LINF = 1LL << 60;
constexpr long long MOD = 1000000007;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
struct SegmentTree {
  typedef function<T(T, T)> F;
  typedef function<T(T, T)> G;
  int n;
  F f;
  G g;
  T e;
  vector<T> val;
  SegmentTree(vector<T> a, F f_, G g_, T e) : f(f_), g(g_), e(e) {
    int sz = a.size();
    n = 1;
    while (n < sz) n <<= 1;
    val.resize(2 * n - 1, e);
    for (int i = 0; i < sz; i++) val[i + n - 1] = a[i];
    for (int i = n - 2; i >= 0; i--) val[i] = f(val[i * 2 + 1], val[i * 2 + 2]);
  }
  SegmentTree() {}
  void update(int pos, T v) {
    int k = pos + n - 1;
    val[k] = g(val[k], v);
    while (k > 0) {
      k = (k - 1) / 2;
      val[k] = f(val[k * 2 + 1], val[k * 2 + 2]);
    }
  }
  T get(int pos) {
    int k = pos + n - 1;
    return val[k];
  }
  T query(int a, int b, int k = 0, int l = 0, int r = -1) {
    if (r < 0) r = n;
    if (r <= a || b <= l) return e;
    if (a <= l && r <= b) return val[k];
    T lv = query(a, b, k * 2 + 1, l, (l + r) / 2);
    T rv = query(a, b, k * 2 + 2, (l + r) / 2, r);
    return f(lv, rv);
  }
};
template <class T>
void remove_duplication(vector<T>& v) {
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
}
void Main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(N);
  for (int i = (0); i < (N); ++i) cin >> A[i];
  vector<int> B(A);
  remove_duplication(B);
  SegmentTree<int> st(
      A, [](int a, int b) { return min(a, b); }, [](int a, int b) { return b; },
      INF);
  int ans = INF;
  int k = B.size();
  for (int i = (0); i < (k); ++i) {
    int ptr = 0;
    vector<int> q;
    while (ptr < N - K + 1) {
      while (ptr < N - K + 1 && A[ptr] < B[i]) ptr++;
      if (ptr == N - K + 1) break;
      int l = ptr + K - 2, r = N;
      while (r - l > 1) {
        int x = (l + r) / 2;
        if (st.query(ptr, x) < B[i])
          r = x;
        else
          l = x;
      }
      if (r - ptr < K) {
        ptr = r;
        continue;
      }
      int len = r - ptr;
      vector<int> cand;
      for (int j = (ptr); j < (r); ++j) cand.push_back(A[j]);
      sort((cand).begin(), (cand).end());
      for (int j = (0); j < (len - K + 1); ++j) q.push_back(cand[j]);
      ptr = r;
    }
    if (q.size() < Q) continue;
    chmin(ans, q[Q - 1] - q[0]);
  }
  cout << ans << "\n";
  return;
}
int main(void) {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(15);
  int t = 1;
  for (int _ = (0); _ < (t); ++_) {
    Main();
  }
  return 0;
}
