#include <bits/stdc++.h>
using namespace std;
int main() {
  long long j, k, l, sum, r, y, z, h, x, mini, maxi, kmax, d, i, g, n, m, q, w,
      st, viv, v, t, p, b;
  cin >> n;
  cin >> k;
  cin >> b;
  vector<pair<long long, long long> > a(n - 1);
  vector<long long> c(n - 1);
  for (i = 0; i < n - 1; i++) {
    cin >> a[i].first;
    c[i] = a[i].first;
    a[i].second = i + 1;
  }
  cin >> p;
  sort(a.begin(), a.end());
  sort(c.begin(), c.end());
  k = min(k, n - 1);
  sum = 0;
  for (i = 0; i < k; i++) {
    sum = sum + a[n - 2 - i].first;
  }
  if (b >= sum) {
    cout << n << endl;
  } else {
    x = sum - b;
    y = a[n - 2 - k + 1].first - x;
    l = upper_bound(c.begin(), c.end(), y) - c.begin();
    if (l == n - 1) {
      cout << n << endl;
    } else {
      m = a[l].second;
      for (i = l; i < n - 1; i++) {
        m = min(m, a[i].second);
      }
      cout << m << endl;
    }
  }
  return 0;
}
