#include <bits/stdc++.h>
using namespace std;
long long n, k, q, ar[200000], ans = 1e9 + 7;
int main() {
  cin >> n >> k >> q;
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
  }
  for (int i = 0; i < n; i++) {
    long long s = ar[i];
    multiset<long long> nums;
    multiset<long long> possible;
    for (int j = 0; j < n; j++) {
      if (ar[j] < s) {
        while (nums.size() >= k) {
          possible.insert(*(nums.begin()));
          nums.erase(nums.begin());
        }
        nums.clear();
      } else
        nums.insert(ar[j]);
    }
    while (nums.size() >= k) {
      possible.insert(*(nums.begin()));
      nums.erase(nums.begin());
    }
    nums.clear();
    long long mini = (possible.empty()) ? -1 : *(possible.begin());
    long long maxi = mini;
    for (int j = 0; j < q; j++) {
      if (possible.empty()) {
        maxi = 1e9 + 7;
        break;
      }
      maxi = *(possible.begin());
      possible.erase(possible.begin());
    }
    ans = min(ans, maxi - mini);
  }
  cout << ans;
  return 0;
}
