#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 * 1000 + 10;
set<pair<int, int> > s;
long long sum;
long long a[maxn];
long long b;
int k, n;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k;
  cin >> b;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n - 1; ++i) s.insert(pair<int, int>(a[i], i));
  while (s.size() > k) s.erase(s.begin());
  for (set<pair<int, int> >::iterator it = s.begin(); it != s.end(); ++it)
    sum += it->first;
  for (int i = 1; i <= n - 1; ++i) {
    if (s.find(pair<int, int>(a[i], i)) != s.end()) {
      if (sum > b) {
        cout << i << endl;
        return 0;
      }
    } else {
      sum -= s.begin()->first;
      sum += a[i];
      if (sum > b) {
        cout << i << endl;
        return 0;
      }
      sum += s.begin()->first;
      sum -= a[i];
    }
  }
  cout << n << endl;
  return 0;
}
