#include <bits/stdc++.h>
using namespace std;
struct data {
  int a, id;
  data(){};
  data(int a_, int id_) : a(a_), id(id_) {}
};
bool operator<(const data &a1, const data &a2) { return a1.a > a2.a; }
int main() {
  int n, k, no, ans;
  long long b;
  cin >> n >> k;
  cin >> b;
  vector<data> store;
  for (int i = 0; i < n; i++) {
    cin >> no;
    if (i == n - 1) continue;
    store.push_back(data(no, i));
  }
  sort(store.begin(), store.end());
  long long sum = 0;
  ans = n - 1;
  int ans2 = n - 1;
  for (int i = 0; i < k; i++) {
    sum += store[i].a;
    ans2 = min(ans2, store[i].id);
  }
  if (sum > b) {
    ans = ans2;
  }
  for (int i = k; i < n - 1; i++) {
    if (sum + store[i].a - store[k - 1].a > b) ans = min(ans, store[i].id);
  }
  cout << ans + 1 << endl;
  return 0;
}
