#include <bits/stdc++.h>
using namespace std;
struct par {
  long long c, nr;
};
bool porownanie(par a, par b) {
  if (a.c > b.c) return true;
  if (a.c < b.c) return false;
  if (a.nr < b.nr) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  long long n, k, b;
  cin >> n >> k >> b;
  --n;
  vector<par> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i].c;
    a[i].nr = i;
  }
  long long ost;
  cin >> ost;
  sort(a.begin(), a.end(), porownanie);
  int odp = n + 1;
  vector<long long> pref(n, 0);
  pref[0] = a[0].c;
  for (int i = 1; i < n; ++i) pref[i] = pref[i - 1] + a[i].c;
  for (int i = 0; i < n; ++i) {
    long long s;
    if (k != 1) {
      if (i <= k - 2)
        s = pref[k - 1] - a[i].c;
      else
        s = pref[k - 2];
    } else
      s = 0;
    if (b - s < a[i].c) odp = min(odp, (int)a[i].nr + 1);
  }
  cout << odp;
  return 0;
}
