#include <bits/stdc++.h>
using namespace std;
long long a[2010];
vector<long long> b;
set<pair<long long, long long>> s;
long long mx = -1e9 - 7;
long long mn = 1e9 + 7;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, k, q;
  cin >> n >> k >> q;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < q; i++) {
    s.clear();
    for (long long j = 0; j < k; j++) {
      s.insert({a[j], j});
    }
    pair<long long, long long> p = {1e9 + 7, -1};
    if (p.first > s.begin()->first) {
      p = *s.begin();
    }
    for (long long j = k; j < n; j++) {
      s.insert({a[j], j});
      s.erase({a[j - k], j - k});
      if (p.first > s.begin()->first) {
        p = *s.begin();
      }
    }
    for (long long j = 0; j < n; j++) {
      if (p.second != j) {
        b.push_back(a[j]);
      }
    }
    n = (long long)b.size();
    for (long long j = 0; j < n; j++) {
      a[j] = b[j];
    }
    b.clear();
    mn = min(mn, p.first);
    mx = max(mx, p.first);
  }
  cout << mx - mn << endl;
  return 0;
}
