#include <bits/stdc++.h>
using namespace std;
long long n, k, q;
vector<long long> v, lis;
int main() {
  cin >> n >> k >> q;
  for (signed long long i = 0; i < (n); i++) {
    long long h;
    cin >> h;
    v.push_back(h);
    lis.push_back(h);
  }
  sort(v.begin(), v.end());
  long long ans = 1e10;
  for (signed long long basis = 0; basis < ((signed)v.size() - k + 1);
       basis++) {
    vector<long long> grid[100000], can;
    long long itr = 0;
    for (auto &i : lis) {
      if (i < v[basis]) {
        itr++;
        continue;
      }
      grid[itr].push_back(i);
    }
    for (signed long long i = 0; i < (itr + 1); i++) {
      sort(grid[i].begin(), grid[i].end());
      for (signed long long j = 0; j < ((signed)grid[i].size() - k + 1); j++) {
        can.push_back(grid[i][j]);
      }
    }
    sort(can.begin(), can.end());
    ans = min(ans, can[q - 1] - can[0]);
  }
  cout << ans << endl;
}
