#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
const long long INF = 1e17;
struct square {
  long long s;
  int id;
};
square a[MAXN];
long long s[MAXN];
int pos[MAXN];
bool getS(const square &a, const square &b) {
  return a.s > b.s || a.s == b.s && a.id < b.id;
}
void solve() {
  int n, k;
  long long b;
  scanf("%d%d", &n, &k);
  scanf("%I64d", &b);
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &a[i].s);
    a[i].id = i;
  }
  sort(a, a + n - 1, getS);
  int ans = n - 1;
  for (int i = 0; i < n; i++) {
    s[i] = a[i].s;
    if (i) s[i] += s[i - 1];
  }
  for (int i = 0; i < n; i++) {
    pos[a[i].id] = i;
  }
  long long cur;
  for (int i = 0; i < n - 1; i++) {
    if (pos[i] < k) {
      cur = s[min(n - 1, k - 1)];
      cur -= a[pos[i]].s;
    } else {
      cur = s[min(n - 1, k - 2)];
    }
    if (cur > b - a[pos[i]].s) {
      ans = min(ans, i);
    }
  }
  cout << ans + 1;
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
