#include <bits/stdc++.h>
using namespace std;
int su[2005];
vector<pair<int, int> > v;
int ok[2005];
int suu[2005];
priority_queue<int> pq[2005];
int main() {
  int n, m, q;
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &su[i]);
    v.push_back({su[i], i});
  }
  int ans = 2100000000;
  sort(v.begin(), v.end(), greater<pair<int, int> >());
  for (int i = 0; i < n; i++) {
    int me = v[i].second;
    ok[me] = 1;
    if (ok[me - 1] && ok[me + 1]) {
      for (int j = me - 1; ok[j]; j--) {
        if (su[j] > su[j + 1]) {
          int tmp = su[j];
          su[j] = su[j + 1];
          su[j + 1] = tmp;
        } else {
          break;
        }
      }
      int s1, s2, e1, e2;
      s2 = me;
      s1 = me;
      while (ok[s1 - 1]) s1--;
      e1 = me + 1;
      e2 = me + 1;
      while (ok[e2 + 1]) e2++;
      for (int j = s1; j <= e2; j++) suu[j] = su[j];
      int pp = s1;
      while ((s1 <= s2) || (e1 <= e2)) {
        if (s1 > s2) {
          su[pp] = suu[e1];
          e1++;
        } else if (e1 > e2) {
          su[pp] = suu[s1];
          s1++;
        } else {
          if (su[s1] < su[e1]) {
            su[pp] = suu[s1];
            s1++;
          } else {
            su[pp] = suu[e1];
            e1++;
          }
        }
        pp++;
      }
    } else if (ok[me + 1]) {
      for (int j = me; ok[j + 1]; j++) {
        if (su[j] > su[j + 1]) {
          int tmp = su[j];
          su[j] = su[j + 1];
          su[j + 1] = tmp;
        } else {
          break;
        }
      }
    } else if (ok[me - 1]) {
      for (int j = me - 1; ok[j]; j--) {
        if (su[j] > su[j + 1]) {
          int tmp = su[j];
          su[j] = su[j + 1];
          su[j + 1] = tmp;
        } else {
          break;
        }
      }
    }
    int now = 1, sz = 0;
    int mn = 2100000000;
    while (now <= n) {
      if (!ok[now])
        now++;
      else {
        int nxt = now;
        while (ok[nxt]) nxt++;
        for (int j = now; j <= nxt - m; j++) {
          pq[i].push(su[j]);
          mn = min(mn, su[j]);
          sz++;
          if (sz > q) {
            pq[i].pop();
            sz--;
          }
        }
        now = nxt;
      }
    }
    if (mn != v[i].first)
      while (1)
        ;
    if (sz == q) {
      ans = min(ans, pq[i].top() - mn);
    }
  }
  printf("%d\n", ans);
}
