#include <bits/stdc++.h>
using namespace std;
int N, K, Q;
vector<pair<int, int> > A;
class Bucket {
 public:
  vector<pair<int, int> > v;
  int num;
  pair<int, int>& operator[](int n) { return v[n]; }
  int sum;
};
class Buckets {
 public:
  vector<Bucket> v;
  int num;
  int allnum;
  Buckets(int N) {
    double sn = sqrt(N);
    v.resize(ceil((double)N / sn));
    for (int n = 0; n < v.size() - 1; n++) {
      v[n].v.resize(floor(sn));
      v[n].num = floor(sn);
      v[n].sum = 0;
    }
    v.back().v.resize(N - (v.size() - 1) * floor(sn));
    v.back().num = N - (v.size() - 1) * floor(sn);
    v.back().sum = 0;
    num = v.size();
    int c = 0;
    for (int b = 0; b < v.size(); b++) {
      for (int n = 0; n < v[b].v.size(); n++, c++) {
        v[b][n] = pair<int, int>(0, c);
      }
    }
    allnum = N;
  }
  Bucket& operator[](int n) { return v[n]; }
  void set(int n) {
    int tn = 0;
    n++;
    int b = 0;
    for (; b < v.size(); b++) {
      tn += v[b].num;
      if (n <= tn) break;
    }
    tn -= v[b].num;
    int c = n - tn - 1;
    v[b][c].first = 1;
    v[b].sum++;
  }
  int get(int n) {
    n++;
    int c = 0;
    int b = 0;
    int ans = 0;
    for (; b < v.size(); b++) {
      if (c + v[b].num <= n) {
        ans += v[b].sum;
        c += v[b].num;
      } else
        break;
    }
    n -= c;
    for (int m = 0; m < n; m++) ans += v[b][m].first;
    return ans;
  }
  int get(int a, int b) {
    int ans = get(b);
    if (a != 0) ans -= get(a - 1);
    return ans;
  }
  void erase(int n) {
    allnum--;
    n++;
    int b = 0;
    int c = 0;
    while (b < num) {
      if (n <= c + v[b].num) break;
      c += v[b].num;
      b++;
    }
    v[b].v.erase(v[b].v.begin() + (n - c - 1));
    v[b].num--;
  }
};
int main() {
  cin >> N >> K >> Q;
  A.resize(N);
  for (int n = 0; n < N; n++) {
    cin >> A[n].first;
    A[n].second = n;
  }
  sort(A.begin(), A.end(),
       [](pair<int, int> a, pair<int, int> b) { return a.first < b.first; });
  Buckets buckets(N);
  int Y = 0;
  int ans = INT_MAX;
  while (Y < N) {
    if (Y != 0) {
      if (A[Y].first == A[Y - 1].first) {
        buckets.set(A[Y].second);
        Y++;
        continue;
      }
    }
    Buckets tempb(buckets);
    int y = Y;
    int q = 0;
    while (y < N) {
      int b = 0;
      int yindex = 0;
      while (b < tempb.num - 1) {
        if (tempb[b].num == 0) {
          b++;
          continue;
        }
        if (tempb[b].v.back().second < A[y].second) {
          yindex += tempb[b].num;
          b++;
        } else
          break;
      }
      for (int c = 0; c < tempb[b].num; c++) {
        if (tempb[b][c].second == A[y].second) {
          yindex += c;
          break;
        }
      }
      int right, left;
      int s = yindex, e = tempb.allnum;
      while (e - s > 1) {
        int m = (e + s) / 2;
        if (tempb.get(yindex, m) >= 1)
          e = m;
        else
          s = m;
      }
      right = s;
      s = -1, e = yindex;
      while (e - s > 1) {
        int m = (e + s) / 2;
        if (tempb.get(m, yindex) >= 1)
          s = m;
        else
          e = m;
      }
      left = e;
      if (right - left + 1 >= K) {
        tempb.erase(yindex);
        q++;
        if (q == Q) {
          ans = min(ans, A[y].first - A[Y].first);
          break;
        }
      }
      y++;
    }
    buckets.set(A[Y].second);
    Y++;
  }
  cout << ans << endl;
  return 0;
}
