#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> w;
int n, cnt;
int m;
bool comp(int a, int b) { return a > b; }
int main(int argc, char **argv) {
  cin >> n >> cnt >> m;
  w.resize(n - 1);
  for (int i = 0; i < n - 1; i++) {
    cin >> w[i].first;
    w[i].second = i;
  }
  sort(w.begin(), w.end(), greater<pair<int, int>>());
  int a = 0, c;
  int min = INT_MAX;
  for (int i = 0; i < cnt; i++) {
    a += w[i].first;
    if (min > w[i].second) min = w[i].second;
  }
  if (a <= m) {
    cout << n;
    return 0;
  }
  int b = a - m;
  c = w[cnt - 1].first;
  for (int i = cnt; i < w.size(); i++) {
    if (c - w[i].first < b && min > w[i].second) min = w[i].second;
  }
  cout << min + 1;
  return 0;
}
