#include <bits/stdc++.h>
using namespace std;
vector<int> vt2[2010];
vector<int> gap;
vector<int> vt;
int p[2010], n, m, k;
int a[2010], sz[2010], update;
vector<vector<int>> vt1;
int ch[2010];
int find(int u) {
  if (p[u] == u) return u;
  return p[u] = find(p[u]);
}
void merge(int u, int v) {
  u = find(u);
  v = find(v);
  sz[v] += sz[u];
  for (int i = 0; i < sz[u]; i++) {
    vt2[v].push_back(vt2[u][i]);
  }
  vt2[u].clear();
  if (sz[v] >= m) {
    update = 1;
    sort(vt2[v].begin(), vt2[v].end());
    int t = sz[v] - m + 1;
    sz[v] = m - 1;
    for (int i = 0; i < t; i++) {
      gap.push_back(vt2[v][i]);
      vt2[v][i] = 2100000000;
    }
    sort(vt2[v].begin(), vt2[v].end());
  }
  sz[u] = 0;
  p[u] = v;
}
int getidx(int x) { return lower_bound(vt.begin(), vt.end(), x) - vt.begin(); }
int main() {
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    vt.push_back(a[i]);
  }
  sort(vt.begin(), vt.end());
  vt1.resize(vt.size());
  for (int i = 1; i <= n; i++) {
    a[i] = getidx(a[i]);
    vt1[a[i]].push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    sz[i] = 1;
    p[i] = i;
    vt2[i].push_back(vt[a[i]]);
  }
  int dap = 2100000000;
  for (int i = vt.size() - 1; i >= 0; i--) {
    for (int y = 0; y < vt1[i].size(); y++) {
      update = 0;
      ch[vt1[i][y]] = 1;
      if (ch[vt1[i][y] - 1]) merge(vt1[i][y] - 1, vt1[i][y]);
      if (ch[vt1[i][y] + 1]) merge(vt1[i][y], vt1[i][y] + 1);
      if (gap.size() >= k && update) {
        sort(gap.begin(), gap.end());
        dap = min(gap[k - 1] - gap[0], dap);
      }
    }
  }
  printf("%d", dap);
}
