#include <bits/stdc++.h>
using namespace std;
int banyak, sisa;
bool ambil[100001];
long long total, makan, haha[100001];
pair<long long, int> biaya[100001];
int main() {
  scanf("%d %d", &banyak, &sisa);
  scanf("%I64d", &total);
  for (int i = 0; i < banyak; ++i) {
    scanf("%I64d", &biaya[i].first);
    biaya[i].second = i;
    haha[i] = biaya[i].first;
  }
  sort(biaya, biaya + banyak - 1, greater<pair<long long, int> >());
  for (int i = 0; i < sisa - 1; ++i) {
    makan += biaya[i].first;
    ambil[biaya[i].second] = true;
  }
  bool flag = true;
  for (int i = 0; i < banyak - 1 && flag; ++i) {
    long long sem;
    if (ambil[i])
      sem = makan - haha[i] + biaya[sisa - 1].first;
    else
      sem = makan;
    if (sem + haha[i] > total) {
      printf("%d\n", i + 1);
      flag = false;
    }
  }
  if (flag) printf("%d\n", banyak);
  return 0;
}
