#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> a[100005];
long long b[100005];
bool c[100005] = {false};
bool cmp(pair<long long, long long> x, pair<long long, long long> y) {
  return x.first > y.first;
}
int main() {
  long long n, k, money;
  cin >> n >> k >> money;
  for (long long i = 0; i < n - 1; i++) {
    cin >> a[i].first;
    a[i].second = i;
    b[i] = a[i].first;
  }
  cin >> a[n - 1].first;
  sort(a, a + n - 1, cmp);
  long long second = 0;
  for (long long i = 0; i < k - 1; i++) {
    c[a[i].second] = true;
    second += a[i].first;
  }
  for (long long i = 0; i < n - 1; i++) {
    long long p = second;
    if (c[i] == true) {
      p = p - b[i];
      p = p + a[k - 1].first;
    }
    if (p + b[i] > money) {
      cout << i + 1 << endl;
      return 0;
    }
  }
  cout << n << endl;
  return 0;
}
