#include <bits/stdc++.h>
using namespace std;
int b[10000];
int a[10000];
int main() {
  ios_base::sync_with_stdio(0);
  int n, k, q;
  cin >> n >> k >> q;
  int ret = 1e9;
  for (int i = 1; i <= n; i++) cin >> a[i], b[i] = a[i];
  sort(b + 1, b + n + 1);
  for (int i = 1; i <= n; i++) {
    cout << b[i] << ' ';
    vector<int> tot;
    for (int j = 1; j <= n;) {
      vector<int> cur;
      while (j <= n && a[j] >= b[i]) {
        cur.push_back(a[j]);
        j++;
      }
      while (j <= n && a[j] < b[i]) j++;
      int len = cur.size();
      int need = len - k + 1;
      sort(cur.begin(), cur.end());
      for (int x = 0; x < need; x++) tot.push_back(cur[x]);
    }
    if (tot.size() >= q) {
      ret = min(ret, tot[q - 1] - b[i]);
    }
  }
  cout << endl;
  cout << ret << endl;
}
