#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
int n, k, q, ans = INF;
void rec(vector<int> v, int mn = INF, int mx = -1, int cq = 0) {
  if (cq == q) {
    ans = min(ans, mx - mn);
  } else {
    for (int i = 0; i <= v.size() - k; i++) {
      vector<int> nv = v;
      int x = i;
      for (int j = 0; j < k; j++) {
        if (nv[x] > nv[i + j]) x = i + j;
      }
      int nmx = max(mx, nv[x]), nmn = min(mn, nv[x]);
      nv.erase(nv.begin() + x);
      rec(nv, nmn, nmx, cq + 1);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> k >> q;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v.push_back(x);
  }
  rec(v);
  cout << ans;
  return 0;
}
