#include <bits/stdc++.h>
using namespace std;
int a[1000000], mn[1000000];
vector<int> v;
int main() {
  int n, k, q, ans = 1e9;
  cin >> n >> k >> q;
  for (register int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (register int i = 1; i <= n - k + 1; i++) {
    mn[i] = 1e9;
    for (register int j = i; j < i + k; j++) mn[i] = min(mn[i], a[j]);
  }
  for (register int i = 1; i <= n - k + 1; i++) {
    int l = i - 1, r = i + 1;
    for (; l >= 1 && mn[l] >= mn[i]; l--)
      ;
    for (; r + k - 1 <= n && mn[r] >= mn[i]; r++)
      ;
    v.clear();
    for (register int j = l + 1; j < r - 1 + k; j++) v.push_back(a[j]);
    if (v.size() - q < k - 1) continue;
    sort(v.begin(), v.end());
    ans = min(ans, v[q - 1] - mn[i]);
  }
  cout << ans;
  return 0;
}
