#include <bits/stdc++.h>
using namespace std;
int a[222222], b[222222];
long long s;
int n, k;
void Solve() {
  for (int i = 1; i <= n - 1; i++) b[i] = a[i];
  sort(b + 1, b + n);
  int p = max(1, n - k);
  long long tong = 0, res;
  for (int i = p; i <= n - 1; i++) tong += b[i];
  b[0] = 0;
  for (int i = 1; i <= n - 1; i++) {
    if (a[i] < b[p])
      res = tong - b[p] + a[i];
    else
      res = tong;
    if (res > s) {
      cout << i;
      return;
    }
  }
  cout << n;
}
int main() {
  cin >> n >> k;
  cin >> s;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  Solve();
  return 0;
}
