#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 100;
long long a[N], tmp[N];
bool f[N];
long long n, k, b, sum;
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> k >> b;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    tmp[i] = i;
  }
  sort(tmp, tmp + n - 1, [&](long long i, long long j) { return a[i] > a[j]; });
  for (long long i = 0; i < k - 1; i++) {
    f[tmp[i]] = true;
    sum += a[tmp[i]];
  }
  for (long long i = 0; i < n - 1; i++) {
    long long res = (!f[i] ? sum + a[i] : sum + a[tmp[k - 1]]);
    if (res > b) return cout << i + 1, 0;
  }
  return cout << n, 0;
}
