#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
int aa[N], ii[N];
int main() {
  int n, k;
  cin >> n >> k;
  long long b;
  cin >> b;
  for (int i = 0; i < n; i++) {
    cin >> aa[i];
    ii[i] = i;
  }
  sort(ii, ii + n - 1, [](int i, int j) { return aa[i] > aa[j]; });
  long long sum = 0;
  for (int h = 0; h < k; h++) sum += aa[ii[h]];
  int a = aa[ii[k - 1]];
  for (int i = 0; i < n - 1; i++)
    if (aa[i] + sum - max(aa[i], a) > b) {
      cout << i + 1 << '\n';
      return 0;
    }
  cout << n << '\n';
  return 0;
}
