#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
const int N = 2e5 + 10;
pair<int, int> a[N];
int main() {
  int n, k;
  cin >> n >> k;
  long long b;
  cin >> b;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  a[n].first = 0;
  sort(a + 1, a + n + 1);
  reverse(a + 1, a + n + 1);
  long long sum = 0;
  for (int i = 1; i < k; i++) {
    sum += a[i].first;
  }
  int ans = n;
  for (int i = 1; i <= n; i++) {
    if (sum + a[max(k, i)].first > b) ans = min(ans, a[i].second);
  }
  cout << ans << endl;
  return 0;
}
