#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  long long b;
  cin >> b;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  vector<pair<int, int> > pairs;
  for (int i = 0; i < n - 1; ++i) {
    pairs.push_back(make_pair(a[i], i));
  }
  sort(pairs.rbegin(), pairs.rend());
  long long max_sum = 0;
  for (int i = 0; i < k; ++i) {
    max_sum += pairs[i].first;
  }
  if (max_sum <= b) {
    cout << n << endl;
    return 0;
  }
  vector<int> pos(n);
  for (int i = 0; i < n - 1; ++i) {
    pos[pairs[i].second] = i;
  }
  for (int i = 0; i < n - 1; ++i) {
    long long sum = max_sum;
    if (pos[i] >= k) {
      sum -= pairs[k - 1].first;
      sum += a[i];
    }
    if (sum > b) {
      cout << i + 1 << endl;
      return 0;
    }
  }
  return 0;
}
