#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9, MOD = 1e9 + 7, ohara = 1e6;
const long long LINF = 1e18;
long long int n, cnt = 0, ans = 0, a[ohara], b, c, d, cmp[ohara], cmpp, m, h, w,
                 x, y, sum = 0, pos, k, Q;
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
string alph("abcdefghijklmnopqrstuvwxyz"), s;
bool fl = true;
struct edge {
  int to, cost;
};
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> k >> Q;
  for (long long int(i) = 0; (i) < (int)(n); (i)++) cin >> a[i];
  long long mi = INF;
  for (long long int(i) = 0; (i) < (int)(Q); (i)++) {
    for (long long int(j) = 0; (j) < (int)(n - k + 1); (j)++) {
      for (long long int kk = (j); kk < (j + k); kk++) {
        mi = min(mi, a[kk]);
      }
    }
    for (long long int(kk) = 0; (kk) < (int)(n); (kk)++) {
      if (a[kk] == mi) {
        a[kk] = INF;
        break;
      }
    }
    cmp[cnt] = mi;
    cnt++;
    mi = INF;
  }
  mi = INF;
  long long ma = 0;
  for (long long int(i) = 0; (i) < (int)(cnt); (i)++) {
    mi = min(mi, cmp[i]);
    if (cmp[i] != INF) {
      ma = max(ma, cmp[i]);
    }
  }
  cout << (ma - mi) << endl;
  return 0;
}
