#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:16777216")
#pragma warning(disable : 4786)
pair<long long, long long> a[100002];
long long sum[100002], val[100002];
set<int> st;
int main() {
  int n, k, i, j, res;
  long long b, t;
  while (cin >> n >> k >> b) {
    for (i = 0; i < n; i++) {
      cin >> a[i].first;
      a[i].second = i;
      val[i] = a[i].first;
    }
    sort(a, a + n);
    reverse(a, a + n);
    t = j = 0;
    st.clear();
    for (i = 0; i < k - 1; i++, j++) {
      if (a[j].second == n - 1) {
        i--;
        continue;
      }
      t += a[j].first;
      st.insert(a[j].second);
    }
    if (a[j].second == n - 1) j++;
    for (i = 0; i < n; i++) {
      if (st.find(i) == st.end())
        sum[i] = t;
      else {
        sum[i] = t - val[i] + a[j].first;
      }
    }
    res = n;
    for (i = 0; i < n; i++) {
      if (val[i] > (b - sum[i])) {
        res = i + 1;
        break;
      }
    }
    printf("%d\n", res);
  }
  return 0;
}
