#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  long long b;
  int a[100010];
  vector<pair<int, int> > v;
  bool use[100010];
  cin >> n >> k;
  cin >> b;
  for (int i = 0; i < (int)(n); i++) {
    cin >> a[i];
    if (i != n - 1) v.push_back(pair<int, int>(a[i], i));
  }
  sort((v).begin(), (v).end(), greater<pair<int, int> >());
  long long sum = 0;
  for (int i = 0; i < n - 1; i++) {
    if (i < k) {
      use[v[i].second] = true;
      sum += v[i].first;
    } else {
      use[v[i].second] = false;
    }
  }
  for (int i = 0; i < n - 1; i++) {
    long long tmp = sum;
    if (!use[i]) tmp += a[i] - v[k - 1].first;
    if (b < tmp) {
      cout << i + 1 << endl;
      return 0;
    }
  }
  cout << n << endl;
}
