#include <bits/stdc++.h>
using namespace std;
int a[100005], n, k;
long long b, sum;
pair<int, int> c[100005];
bool mark[100005];
int main() {
  cin >> n >> k;
  cin >> b;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    c[i] = make_pair(a[i], i);
  }
  sort(c, c + n - 1);
  reverse(c, c + n - 1);
  for (int i = 0; i < k; i++) {
    sum += c[i].first;
    mark[c[i].second] = true;
  }
  for (int i = 0; i < n; i++) {
    if (mark[i]) {
      if (sum > b) {
        cout << i + 1 << endl;
        return 0;
      }
    } else {
      if (sum - c[k - 1].first + a[i] > b) {
        cout << i + 1 << endl;
        return 0;
      }
    }
  }
  cout << n << endl;
}
