#include <bits/stdc++.h>
using namespace std;
vector<long long> a;
vector<long long> c;
int main() {
  int n, k;
  long long m;
  cin >> n >> k >> m;
  a.resize(n - 1);
  c.resize(n - 1);
  long long x;
  for (int i = 0; i < n - 1; i++) {
    cin >> a[i];
    c[i] = a[i];
  }
  cin >> x;
  x = 0;
  sort(c.rbegin(), c.rend());
  for (int i = 0; i < k - 1; i++) {
    x += c[i];
  }
  int res = n - 1;
  for (int j = 0; j < n - 1; j++) {
    long long r = x;
    if (a[j] >= c[k - 2]) {
      r = r - a[j] + c[k - 1];
    }
    if (m - r < a[j]) {
      res = j;
      break;
    }
  }
  cout << res + 1 << endl;
  return 0;
}
