#include <bits/stdc++.h>
using namespace std;
long long a[100005], n, k, b;
pair<long long, long long> c[100005];
int main() {
  cin >> n >> k >> b;
  long long sum = 0;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    c[i].first = a[i];
    c[i].second = i;
  }
  sort(c + 1, c + n);
  reverse(c + 1, c + n);
  map<long long, long long> p;
  for (long long i = 1; i <= k; i++) {
    sum += c[i].first;
    p[c[i].second]++;
  }
  for (long long i = 1; i < n; i++) {
    if (p[i]) {
      if (sum > b) {
        cout << i << endl;
        return 0;
      }
    } else {
      long long v = sum - c[k].first + a[i];
      if (v > b) {
        cout << i << endl;
        return 0;
      }
    }
  }
  cout << n << endl;
}
