#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[2000];
  vector<int> v;
  vector<int> b;
  vector<int> d;
  int n, k, q;
  int x, y;
  int ans;
  bool c;
  ans = 1000000000;
  scanf("%d %d %d", &n, &k, &q);
  for (int i = 0; i < int(n); i++) {
    scanf("%d", &a[i]);
    v.push_back(a[i]);
  }
  sort(v.begin(), v.end());
  for (int ii = 0; ii < int(n); ii++) {
    if (ii == 0)
      c = true;
    else if (v[ii] != v[ii - 1])
      c = true;
    else
      c = false;
    if (c) {
      b.clear();
      x = 0;
      y = 0;
      for (int i = 0; i < int(n); i++) {
        if (a[i] >= v[ii])
          x++;
        else {
          sort(d.begin(), d.end());
          for (int j = 0; j < int(x - k + 1); j++) b.push_back(d[j]);
          x = 0;
          d.clear();
        }
        if (x >= k) {
          y = max(y, i - k + 1);
          for (int j = y; j <= i; j++) d.push_back(a[j]);
          y = i + 1;
        }
      }
      sort(d.begin(), d.end());
      for (int j = 0; j < int(x - k + 1); j++) b.push_back(d[j]);
      sort(b.begin(), b.end());
      if (b.size() < q)
        break;
      else {
        ans = min(ans, b[q - 1] - b[0]);
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
