#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  ios_base::sync_with_stdio(false);
  int t = 1;
  while (t--) solve();
  return 0;
}
int win[101010];
bool cmp(int a, int b) { return win[a] > win[b]; }
void solve() {
  int n, k;
  cin >> n >> k;
  long long mer;
  cin >> mer;
  int ar[101010];
  for (int i = 0; i < n; ++i) {
    cin >> win[i];
    ar[i] = i;
  }
  sort(ar, ar + n - 1, cmp);
  int where[101010];
  k = min(k, n - 1);
  if (k == n - 1) {
    long long sum = 0;
    for (int i = 0; i < n - 1; ++i) {
      sum += win[i];
    }
    if (sum > mer) {
      cout << 1;
    } else
      cout << n;
    return;
  }
  for (int i = 0; i < n - 1; ++i) {
    where[ar[i]] = i;
  }
  long long sumpref = 0;
  for (int i = 0; i < k - 1; ++i) {
    sumpref += win[ar[i]];
  }
  long long sumadd = sumpref + win[ar[k - 1]];
  for (int i = 0; i < n - 1; ++i) {
    long long need;
    if (where[i] >= k) {
      need = sumpref + win[i];
    } else {
      need = sumadd;
    }
    cerr << i << ' ' << need << endl;
    if (need > mer) {
      cout << (i + 1);
      return;
    }
  }
  cout << n;
}
