#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100099;
const int MAXM = 2 * MAXM;
int n, k;
long long b;
struct square {
  int price, id;
  bool operator()(const square& a, const square& b) const {
    if (a.price != b.price) return a.price > b.price;
    return a.id < b.id;
  }
};
square a[MAXN];
int main() {
  cin.sync_with_stdio();
  cin >> n >> k;
  cin >> b;
  int best = n;
  for (int i = 0, _n = (n); i < _n; i++) {
    cin >> a[i].price;
    a[i].id = i;
  }
  sort(a, a + n - 1, square());
  long long sum = 0;
  for (int i = 0, _n = (k); i < _n; i++) {
    sum += a[i].price;
  }
  if (sum <= b) {
    printf("%d\n", best);
    return 0;
  } else {
    for (int i = 0, _n = (k); i < _n; i++) {
      best = min(best, a[i].id + 1);
    }
    sum -= a[k - 1].price;
    for (int i = k, _b = (n - 2); i <= _b; i++) {
      if (sum + a[i].price > b) {
        best = min(best, a[i].id + 1);
      }
    }
  }
  printf("%d\n", best);
  return 0;
}
