#include <bits/stdc++.h>
using namespace std;
int N, K, Q;
int A[2001];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  cin >> N >> K >> Q;
  for (long long i = 0; i <= long long(N - 1); ++i) cin >> A[i];
  set<int> pos;
  multiset<int> cur;
  for (long long i = 0; i <= long long(K - 1); ++i) cur.insert(A[i]);
  for (long long i = K - 1; i <= long long(N - 1); ++i) {
    pos.insert(*cur.begin());
    cur.erase(cur.find(A[i - K + 1]));
    cur.insert(A[i + 1]);
  }
  sort(A, A + N);
  set<int> indexes;
  for (auto i : pos) {
    for (long long j = 0; j <= long long(N - 1); ++j)
      if (A[j] == i) indexes.insert(j);
  }
  if (Q == 1) {
    cout << 0;
    return 0;
  }
  if (K == 1) {
    int ans = 1e9;
    for (long long i = 0; i <= long long(N - 1); ++i) {
      ans = min(ans, abs(A[i + Q - 1] - A[i]));
      if (ans == 0) {
        cout << i << ' ';
        break;
      }
    }
    cout << ans;
  } else {
    int ans = 1e9;
    for (auto i : indexes) {
      ans = min(ans, A[Q + i - 1] - A[i]);
    }
    cout << ans;
  }
}
