#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  long long b;
  cin >> n >> k >> b;
  long long a[n];
  long long c[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  n--;
  for (int i = 0; i < n; i++) c[i] = a[i];
  sort(c, c + n);
  long long tmp = 0;
  for (int i = n - 1; i >= n - k; i--) tmp += c[i];
  if (tmp <= b) {
    cout << n + 1;
    return 0;
  }
  long long last = c[n - k];
  for (int i = 0; i < n; i++) {
    bool ok = false;
    if (a[i] >= last) {
      ok = true;
    } else {
      if (tmp - last + a[i] > b) ok = true;
    }
    if (ok) {
      cout << i + 1;
      return 0;
    }
  }
}
