#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
long long n, k, b, s[maxn], pos[maxn];
struct elem {
  long long val, i;
};
vector<elem> v;
bool cmp(elem a, elem b) {
  if (a.val != b.val) {
    return a.val > b.val;
  } else
    return a.i < b.i;
}
int main() {
  cin >> n >> k >> b;
  v.resize(n - 1);
  for (int i = 0; i < n - 1; i++) {
    cin >> v[i].val;
    v[i].i = i + 1;
  }
  long long t;
  cin >> t;
  sort(v.begin(), v.end(), cmp);
  s[0] = 0;
  for (int i = 0; i < n - 1; i++) {
    s[i + 1] = s[i] + v[i].val;
    pos[v[i].i] = i + 1;
  }
  for (int i = 1; i <= n - 1; i++) {
    long long p = pos[i];
    long long sum = 0;
    if (p > k)
      sum = s[k - 1] + v[p - 1].val;
    else
      sum = s[k];
    if (sum > b) {
      cout << i;
      exit(0);
    }
  }
  cout << n;
}
