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