#include <bits/stdc++.h>
using namespace std;
long long get(long long i, long long arr[], long long n, long long k,
              long long q) {
  vector<long long> hold;
  long long l1 = 0, l2 = 0;
  for (long long j = i - 1; i > -1; j--) {
    if (arr[j] < arr[i]) break;
    l1++;
  }
  for (long long j = i + 1; j < n; j++) {
    if (arr[j] < arr[i]) break;
    l2++;
  }
  if (l1 + l2 + 1 < k) return 10000000000;
  multiset<long long> st;
  for (long long j = 0; j < n; j++) {
    if (j == i) continue;
    if (arr[j] < arr[i]) {
      if (hold.size() > k - 1) {
        sort(hold.begin(), hold.end());
        for (long long j1 = 0; j1 < hold.size() - k + 1; j1++)
          st.insert(hold[j1]);
      }
      hold.clear();
    } else
      hold.push_back(arr[j]);
  }
  if (hold.size() > k - 1) {
    sort(hold.begin(), hold.end());
    for (long long j1 = 0; j1 < hold.size() - k + 1; j1++) st.insert(hold[j1]);
  }
  if (st.size() < q - 1) return 10000000000;
  for (long long j = 1; j <= q - 2; j++) st.erase(st.begin());
  return *st.begin() - arr[i];
  return 10000000000;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k, q;
  cin >> n >> k >> q;
  long long arr[n];
  for (long long i = 0; i < n; i++) cin >> arr[i];
  long long ans = 1e10;
  for (long long i = 0; i < n; i++) {
    long long temp = get(i, arr, n, k, q);
    ans = min(ans, temp);
  }
  cout << ans;
  return 0;
}
