#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 239;
int solve_sub(vector<int> a, int l, int r, int k) {
  int n = (int)a.size();
  sort(a.begin(), a.end());
  int c = 0;
  for (int i = 0; i < n - k + 1; i++) {
    assert(a[i] >= l);
    if (a[i] <= r) c++;
  }
  return c;
}
int can(vector<int> a, int l, int r, int q, int k) {
  int n = (int)a.size();
  int c = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] < l) {
      continue;
    } else {
      int p = i;
      assert(a[i] >= l);
      vector<int> sb = {a[i]};
      while (p + 1 < n && a[p + 1] >= l) {
        assert(a[p + 1] >= l);
        sb.push_back(a[p + 1]);
        p++;
      }
      c += solve_sub(sb, l, r, k);
      i = p;
    }
  }
  return c >= q;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n);
  for (auto &t : a) {
    cin >> t;
  }
  int ans = INF;
  for (int i = 0; i < n; i++) {
    vector<int> na = a;
    na.erase(na.begin() + i);
    {
      int l = a[i] - 1;
      int r = INF;
      while (r - l > 1) {
        int m = (r + l) >> 1;
        if (can(na, a[i], m, q - 1, k))
          r = m;
        else
          l = m;
      }
      if (can(na, a[i], r, q - 1, k)) ans = min(ans, r - a[i]);
    }
  }
  cout << ans << '\n';
}
