#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> v, d;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v.push_back(x);
  }
  d = v;
  sort(d.begin(), d.end());
  v.push_back(-1e9);
  int mi = 1e9;
  for (int i = 0; i < n - k; i++) {
    vector<int> now;
    vector<int> g;
    for (auto j : v) {
      if (j < d[i]) {
        sort(now.begin(), now.end());
        for (int l = 0; l < (int)now.size() - k + 1; l++) {
          g.push_back(now[l]);
        }
        now.clear();
      } else {
        now.push_back(j);
      }
    }
    if ((int)g.size() >= q) {
      sort(g.begin(), g.end());
      mi = min(mi, g[q - 1] - g[0]);
    }
  }
  cout << mi << '\n';
}
