#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[100100];
int main() {
  int n, k;
  long long b;
  cin >> n >> k >> b;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  long long sum = 0;
  sort(a, a + n - 1, greater<pair<int, int> >());
  for (int i = 0; i < k - 1; i++) sum += a[i].first;
  int best = n;
  for (int i = 0; i < n - 1; i++) {
    long long res = sum;
    if (a[i].first > a[k - 1].first)
      res += a[k - 1].first;
    else
      res += a[i].first;
    if (res > b) {
      best = min(best, a[i].second + 1);
    }
  }
  cout << best;
}
