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