#include <bits/stdc++.h>
using namespace std;
const long maxn = 1e5 + 5;
pair<long long, long> a[maxn];
long long temp[maxn];
long long b;
long n, k;
bool was[maxn];
void finish(long it) {
  printf("%ld", it);
  exit(0);
}
int main() {
  scanf("%ld%ld", &n, &k);
  cin >> b;
  long q;
  for (q = 1; q < n; q++) {
    cin >> a[q].first;
    temp[q] = a[q].first;
    a[q].second = q;
  }
  sort(a + 1, a + n + 1);
  reverse(a + 1, a + n + 1);
  long long sum = 0;
  for (q = 1; q < k; q++) {
    was[a[q].second] = true;
    sum += a[q].first;
  }
  long long s;
  for (long it = 1; it < n; it++) {
    if (was[it]) {
      s = sum - temp[it] + a[k].first;
      if (s + temp[it] > b) finish(it);
    } else {
      s = sum;
      if (s + temp[it] > b) finish(it);
    }
  }
  printf("%ld", n);
}
