#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[100007];
int n, k, pos[100007], res;
long long b, s[100007], t;
bool mycmp(const pair<int, int>& a, const pair<int, int>& b) {
  return (a.first > b.first);
}
int main() {
  scanf("%d%d", &n, &k);
  scanf("%I64d", &b);
  for (int i = 1; i < n; i++) {
    scanf("%d", &a[i].first);
    a[i].second = i;
  }
  sort(a + 1, a + n + 1, mycmp);
  s[0] = 0;
  for (int i = 1; i <= k; i++) s[i] = s[i - 1] + a[i].first;
  res = n;
  for (int i = 1; i < n; i++) {
    if (i >= k)
      t = s[k - 1] + a[i].first;
    else
      t = s[k];
    if (t > b) res = min(res, a[i].second);
  }
  printf("%d\n", res);
  return 0;
}
