#include <bits/stdc++.h>
using namespace std;
int n, k;
long long b;
long long a[100005];
long long va[100005];
long long sum;
int main() {
  cin >> n >> k >> b;
  for (int i = 0; i < n; i++) cin >> a[i], va[i] = a[i];
  sort(va, va + n - 1, greater<long long>());
  for (int i = 0; i < k; i++) sum += va[i];
  if (sum <= b) return cout << n << endl, 0;
  for (int i = 0; i < n; i++) {
    if (a[i] >= va[k - 1]) return cout << i + 1 << endl, 0;
    if (a[i] + sum - va[k - 1] > b) return cout << i + 1 << endl, 0;
  }
  return 0;
}
