#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long LINF = (long long)1e18;
const long double PI = acos((long double)-1);
const long double EPS = 1e-9;
inline long long gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
inline long long fpow(long long n, long long k, int p = MOD) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
inline long long isqrt(long long k) {
  long long r = sqrt(k) + 1;
  while (r * r > k) r--;
  return r;
}
inline long long icbrt(long long k) {
  long long r = cbrt(k) + 1;
  while (r * r * r > k) r--;
  return r;
}
inline int inv(int a, int p = MOD) { return fpow(a, p - 2, p); }
inline int sign(long double x) { return x < -EPS ? -1 : x > +EPS; }
inline int sign(long double x, long double y) { return sign(x - y); }
template <class T>
inline void dbv(T a) {
  for (auto x : a) {
    cout << x << " ** ";
  }
  cout << endl;
}
void output() {
  long long n, k, q;
  cin >> n >> k >> q;
  vector<long long> a(n);
  for (int i = (0); i < (n); ++i) {
    cin >> a[i];
  }
  vector<long long> b = a;
  long long ans = LINF;
  sort(b.begin(), b.end());
  for (long long cut : b) {
    vector<long long> m(n);
    for (int i = (0); i < (n); ++i) {
      if (a[i] < cut) {
        m[i] = 0;
      } else {
        m[i] = 1;
      }
    }
    vector<long long> temp;
    vector<long long> el;
    for (int i = (0); i < (n); ++i) {
      if (m[i] == 1) {
        temp.push_back(a[i]);
      } else {
        sort(temp.begin(), temp.end());
        if (temp.size() >= k) {
          for (int j = (0); j < (temp.size() - k + 1); ++j) {
            (cout << j << " ** " << endl);
            el.push_back(temp[j]);
          }
        }
        temp.clear();
      }
    }
    if (temp.size() >= k) {
      for (int j = (0); j < (temp.size() - k + 1); ++j) {
        el.push_back(temp[j]);
      }
    }
    sort(el.begin(), el.end());
    if (el.size() >= q) {
      ans = min(ans, el[q - 1] - el[0]);
    }
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  for (int i = (0); i < (t); ++i) {
    output();
  }
  return 0;
}
