#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:134217728")
using namespace std;
int n, k;
int a[1 << 17];
long long b;
int main() {
  scanf("%d%d", &n, &k);
  scanf("%I64d", &b);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  vector<pair<int, int> > p;
  for (int i = 0; i < n - 1; ++i) p.push_back(make_pair(-a[i], i));
  sort(p.begin(), p.end());
  long long s = 0;
  for (int i = 0; i < k; ++i) s += -p[i].first;
  int res = n;
  if (s <= b)
    printf("%d\n", n);
  else {
    for (int i = 0; i < n - 1; ++i) {
      long long ss = s - (-p[k - 1].first) + (-p[i].first);
      if (ss > b) res = min(res, p[i].second + 1);
    }
    printf("%d\n", res);
  }
  return 0;
}
