#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000007;
int main(void) {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(N);
  vector<int> cans(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    cans[i] = A[i];
  }
  sort(cans.begin(), cans.end());
  cans.erase(unique(cans.begin(), cans.end()), cans.end());
  int ans = INF;
  set<pair<int, int>> ms;
  for (int i = 0; i < cans.size(); i++) {
    int can = cans[i];
    int Q_remain = Q;
    vector<int> Atmp = A;
    while (Q > 0) {
      ms.clear();
      pair<int, int> min_greater_or_equal_can = {-1, -1};
      for (int j = 0; j < Atmp.size(); j++) {
        ms.insert({Atmp[j], j});
        if (0 <= j - K) {
          ms.erase({Atmp[j - K], j - K});
        }
        pair<int, int> crt_min = {-1, -1};
        if (-1 <= j - K) {
          crt_min = (*ms.begin());
        }
        if (can <= crt_min.first) {
          if (crt_min.first < min_greater_or_equal_can.first ||
              min_greater_or_equal_can.first == -1) {
            min_greater_or_equal_can = crt_min;
          }
        }
      }
      if (min_greater_or_equal_can.second == -1 ||
          (Q == Q_remain && min_greater_or_equal_can.first != can))
        break;
      can = min_greater_or_equal_can.first;
      int idx = min_greater_or_equal_can.second;
      Atmp.erase(Atmp.begin() + idx);
      Q_remain--;
      if (Q_remain == 0) ans = min(ans, can - cans[i]);
    }
  }
  cout << ans << endl;
}
