#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  long long b;
  cin >> n >> k >> b;
  int *a = new int[100001], *c = new int[100001];
  for (int i = 0; i < n; i++) cin >> a[i];
  n--;
  for (int i = 0; i < n; i++) c[i] = a[i];
  sort(c, c + n);
  long long sk = 0;
  for (int i = n - 1; i >= n - k; i--) sk += c[i];
  if (b >= sk) {
    cout << n + 1;
    return 0;
  }
  bool p;
  int last = c[n - k];
  for (int i = 0; i < n; i++) {
    p = false;
    if (a[i] >= last)
      p = true;
    else if (sk - last + a[i] > b)
      p = true;
    if (p) {
      cout << i + 1;
      return 0;
    }
  }
  return 0;
}
