#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
struct NODE {
  int val, id;
  bool operator<(const NODE &B) const { return val > B.val; }
};
NODE a[MAXN];
int vis[MAXN];
int main() {
  int n, k;
  long long b, sum = 0;
  cin >> n >> k >> b;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].val;
    a[i].id = i;
  }
  sort(a + 1, a + n);
  int ans = n;
  for (int i = 1; i < k; i++) {
    sum += a[i].val;
    vis[a[i].id] = 1;
    ans = min(ans, a[i].id);
  }
  if (sum + a[k].val <= b) {
    cout << n << endl;
    return 0;
  }
  for (int i = 1; i < n; i++) {
    if (!vis[a[i].id] && sum + a[i].val > b) {
      ans = min(ans, a[i].id);
    }
  }
  cout << ans << endl;
  return 0;
}
