#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void chkmax(T& x, U y) {
  if (x < y) x = y;
}
template <typename T, typename U>
inline void chkmin(T& x, U y) {
  if (y < x) x = y;
}
const int MAXN = 111111;
int id[MAXN];
long long a[MAXN];
bool cmp(int u, int v) { return a[u] > a[v]; }
int main() {
  int n, k;
  long long b;
  cin >> n >> k >> b;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]), id[i] = i;
  }
  sort(id + 1, id + n, cmp);
  long long sum = 0;
  for (int i = 1; i <= k; i++) sum += a[id[i]];
  if (sum <= b) {
    printf("%d\n", n);
    return 0;
  }
  int ans = n;
  for (int i = 1; i <= n - 1; i++) {
    if (i <= k) {
      chkmin(ans, id[i]);
    } else {
      if (sum - a[id[k]] + a[id[i]] > b) {
        chkmin(ans, id[i]);
      } else {
        break;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
