#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, int> > a;
int main() {
  int n, k, i, ans;
  long long s, p, x, S;
  scanf("%d%d", &n, &k);
  scanf("%lld", &S);
  for (i = 0; i < n; i++) {
    scanf("%lld", &x);
    if (n - 1 != i) a.push_back(make_pair(x, i));
  }
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  s = 0;
  for (i = 0; i < (k - 1); i++) s += a[i].first;
  ans = n;
  for (i = 0; i < (k - 1); i++) {
    p = s - a[i].first + a[k - 1].first;
    if (S - p < a[i].first) ans = min(ans, a[i].second + 1);
  }
  for (; i < n; i++)
    if (S - s < a[i].first) ans = min(ans, a[i].second + 1);
  printf("%d\n", ans);
  return 0;
}
