#include <bits/stdc++.h>
using namespace std;
struct pairhash {
 public:
  template <typename T, typename U>
  size_t operator()(const pair<T, U>& x) const {
    size_t seed = hash<T>()(x.first);
    return hash<U>()(x.second) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
  }
};
const int inf = 1e9 + 9;
const long long mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);
int n, k, q;
int a[2010];
template <typename T>
class SegmentTree {
  class Node {
   public:
    long long l, r;
    T data;
    Node* child_L;
    Node* child_R;
    Node(long long l, long long r, T data) {
      this->l = l;
      this->r = r;
      this->data = data;
      this->child_L = nullptr;
      this->child_R = nullptr;
    }
  };
  Node* root;
  long long N;
  const T init = 1e9 + 9;
  T op(const T& a, const T& b) { return min(a, b); }

 public:
  SegmentTree(long long n) {
    this->N = n;
    this->root = new Node(0, n, init);
  }
  void update(Node* node, long long k, T a) {
    if (node->l <= k && k < node->r) {
      if (node->l == k && node->r == k + 1) {
        node->data = a;
      } else {
        if (node->child_L == nullptr) {
          long long mid = (node->l + node->r) / 2;
          node->child_L = new Node(node->l, mid, init);
          node->child_R = new Node(mid, node->r, init);
        }
        update(node->child_L, k, a);
        update(node->child_R, k, a);
        node->data = op(node->child_L->data, node->child_R->data);
      }
    }
  }
  void update(long long k, T a) { update(this->root, k, a); }
  void add(Node* node, long long k, T a) {
    if (node->l <= k && k < node->r) {
      if (node->l == k && node->r == k + 1) {
        node->data += a;
      } else {
        if (node->child_L == nullptr) {
          long long mid = (node->l + node->r) / 2;
          node->child_L = new Node(node->l, mid, init);
          node->child_R = new Node(mid, node->r, init);
        }
        add(node->child_L, k, a);
        add(node->child_R, k, a);
        node->data = op(node->child_L->data, node->child_R->data);
      }
    }
  }
  void add(long long k, T a) { add(this->root, k, a); }
  T query(Node* node, long long l, long long r) {
    if (node == nullptr || node->r <= l || r <= node->l) return init;
    if (l <= node->l && node->r <= r) return node->data;
    return op(query(node->child_L, l, r), query(node->child_R, l, r));
  }
  T query(long long l, long long r) { return query(this->root, l, r); }
  T get(long long i) { return query(this->root, i, i + 1); }
};
int solve() {
  map<int, int> m;
  for (int i = 0; i < n; i++) m[a[i]]++;
  SegmentTree<int> sg(n);
  for (int i = 0; i < n; i++) {
    sg.add(i, a[i]);
  }
  set<int> s;
  vector<int> vec;
  for (int i = 0; i < n - k + 1; i++) {
    s.insert(sg.query(i, i + k));
  }
  for (int v : s) {
    for (int i = 0; i < m[v]; i++) vec.push_back(v);
  }
  sort((vec).begin(), (vec).end());
  if (vec.size() < q) {
    sort(a, a + n);
    return a[q - 1] - a[0];
  }
  int res = inf;
  for (int i = 0; i < vec.size() - q + 1; i++) {
    res = min(res, vec[i + q - 1] - vec[i]);
  }
  return res;
}
void input() {
  cin >> n >> k >> q;
  for (int i = 0; i < n; i++) cin >> a[i];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(15);
  input();
  cout << solve() << '\n';
}
