#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using std::cerr;
using std::cin;
using std::cos;
using std::cout;
using std::endl;
using std::make_pair;
using std::max;
using std::min;
using std::next_permutation;
using std::pair;
using std::priority_queue;
using std::queue;
using std::random_shuffle;
using std::set;
using std::sin;
using std::sort;
using std::sqrt;
using std::stack;
using std::string;
using std::stringstream;
using std::swap;
using std::vector;
const long double PI = 3.14159265358979323846;
int main() {
  int n, k;
  cin >> n >> k;
  long long cash;
  cin >> cash;
  vector<pair<int, int> > data(n - 1);
  vector<int> da(n - 1);
  for (int i = 0; i < n - 1; ++i) {
    cin >> data[i].first;
    da[i] = data[i].first;
    data[i].second = i;
  }
  sort(data.begin(), data.end());
  long long res = 0;
  for (int i = 0; i < k - 1; ++i) res += data[n - i - 2].first;
  if (res >= cash) {
    cout << 1 << endl;
    return 0;
  }
  res += data[n - k - 1].first;
  if (res <= cash) {
    cout << n << endl;
    return 0;
  }
  long long x = res - cash;
  int in = n;
  for (int i = 0; i < k; ++i) in = min(in, data[n - 2 - i].second);
  int ans = in;
  for (int i = in - 1; i >= 0; --i)
    if (da[i] + x > data[n - k - 1].first) ans = i;
  cout << ans + 1 << endl;
  return 0;
}
